[R] cbind function

Henrique Dallazuanna wwwhsd at gmail.com
Tue Nov 13 17:59:06 CET 2007


Try this:

sapply(ls(patt="^var[0-9]"), get)

On 13/11/2007, livia <yn19832 at msn.com> wrote:
>
> Hello everyone,
>
> I would like to use the "cbind" function to construct a dataset, combining
> some variable I defined before.
> The codes are something like
>
> var1 <- ...
> var2 <- ...
> var2 <- ...
> ...
> data <- cbind(var1,var2,var3...)
>
> The problem is I would like some flexibity in the data, i.e. the number of
> the variables are not fixed. Is there a method of combine the uncertain
> number of variables defined previously?
>
> Could anyone give me some advice?Many thanks.
> --
> View this message in context: http://www.nabble.com/cbind-function-tf4799148.html#a13730001
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list