Is there a way to use a string as an argument to a function. In my example, I have three vectors, and I can use cbind to combine them.
> df1<-1:3
> df2<-11:13
> df3<-21:23
>
> cbind(df1, df2, df3)
df1 df2 df3
[1,] 1 11 21
[2,] 2 12 22
[3,] 3 13 23
Suppose I have a line that is "df1, df2, df3".
> x <- 'df1, df2, df3'
Is there a way to use the contents of a string in cbind? For example, I need a way to do the following ...
> cbind(x)
df1 df2 df3
[1,] 1 11 21
[2,] 2 12 22
[3,] 3 13 23
In fact, he does this ...
> cbind(x)
x
[1,] "df1, df2, df3"
Is there a way to trick the cbind function to view the contents of a string?
Any help is greatly appreciated.
source
share