I have saved text using paste, now i want to run as code.
eg: i have below data
data
a b c
[1,] 1 2 3
[2,] 2 3 2
[3,] 3 4 3
[4,] 4 2 1
I want to create subset data1 having a,b
i created a variable having a,b
variable<-paste("a,","b")
script=paste("data1=subset(data,select=c(",variable,"))")
script
[1] "data1=subset(data,select=c( a, b ))"
now how to run this as script and get data1?