Java Mailing List Archive

http://www.r-help.com/

Home » R Help for Statistical Computing »

[R] Converting a character string into a data frame name and
 performing assignments to that data frame

Kavitha Venkatesan

2010-03-20

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

I would like to do the following operations:

variable.df is a character string that contains the name of the data
frame that I want to do the following operations on:

variable.df <- data.frame();
# I can do the above command using
assign( variable.df, data.frame() )

How can I perform the assignment statements below ?

colnames(variable.df) = colnames(some.other.df)
variable.df = rbind(variable.df, some.other.df)
write.table(variable.df, file=some.file)

Doing
eval( substitute( colnames(var), list(var=as.name(variable.df) ) ) )
didn't get me all the way there.

Thanks!
Kavitha

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.