[R] assign vector name

jim holtman jholtman at gmail.com
Fri Nov 30 17:17:34 CET 2007


Not exactly sure what name you want, but try:

 assign(paste("myname", name[1]), seq(1:10))

On Nov 30, 2007 11:12 AM, livia <yn19832 at msn.com> wrote:
>
> Hello,
>
> I have got a vector, for example seq(1:10), and I have an array "name"
> defined before which contain the vector name I would like to use. So
> name[1]= "price". I would like to name the vector in the following codes:
>
> paste("myname", name[1]) <- seq(1:10)
>
> But it does not work. Could anyone give me some advice? Many thanks.
> --
> View this message in context: http://www.nabble.com/assign-vector-name-tf4918696.html#a14077275
> 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list