Example: I have the following parameter table:
df <- data.frame(vn=letters[1:3],values=1:3)
I want an automatic way to realize the following R code:
a <- 1
b <- 2
c <- 3
I know I can do the following to brute force it:
invisible(lapply(1:nrow(df), function(x) assign(df[x,1], df[x,2], envir=.GlobalEnv)))
But I am looking for a more beautiful way to do it.