for assign(x,value), x should be the name of the variable, not the value, so x should be in the form of the: character assign("a","new"), and for use in your function try:
test <- function (x)
{
assign(deparse(substitute(x)), "new", envir = .GlobalEnv)
}
in your case, you create a variable named "old" and assign it to "new":
> old
[1] "new"
source
share