[R] Problem with cbind() and arguments

parlor9 krol_mendez at hotmail.com
Mon Nov 26 06:48:19 CET 2012


Hello,
I am using Rscript and arguments, and I have to create a object, here is a
small example:
-I have P:
a   b
1   2
1   2
1   2

-And I want this result:
a   b   c
1   2   3
1   2   3
1   2   3

So I pass 'c' as an Rscript argument and use this command:

>P<-cbind(P,args[1]=5)

-But then it will return me this:
a   b   args[1]
1   2   3
1   2   3
1   2   3

I couldn't transform args[1] value 'c' into 'r code', instead of just a
string..
Could anyone give me a hand here? Thanks in advance!



--
View this message in context: http://r.789695.n4.nabble.com/Problem-with-cbind-and-arguments-tp4650808.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list