Skip to content
Back to formatted view

Raw Message

Message-ID: <419B2669.20407@statistik.uni-dortmund.de>
Date: 2004-11-17T10:22:33Z
From: Uwe Ligges
Subject: changing character to a vector name
In-Reply-To: <BAY12-F174FTA7OIkUq0001157c@hotmail.com>

Laura Holt wrote:

> Dear R People:
> 
> I would like to generate a vector/variable name from within a loop to be 
> passed to a table
> function.
> 
> This is what I have so far:
> 
>> assign("p1",paste("raw3.df$",rw2$V1[3],sep=""))
>> p1
 >
> [1] "raw3.df$CITIZEN"

Life is much easier: Consider to use raw3.df[[rw2$V1[3]]] instead.

Uwe Ligges


>>
> Essentially, I want to use the raw3.df$CITIZEN along with another value 
> to generate a table.
> 
> However, I'm stuck here.  I know this is incredibly stupid.
> 
> Thanks in advance.
> Sincerely
> Laura Holt
> mailto: lauraholt_983 at hotmail.com
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html