Re: [R] Copying a dataframe

2013-03-07 Thread John Kane
l.com > Sent: Thu, 7 Mar 2013 17:23:10 + > To: r-help@r-project.org > Subject: [R] Copying a dataframe > > Hi, I am trying to create a data frame using the dimensions of another > data > frame that I have input. This is the code I am using: > > tab is the data frame

Re: [R] Copying a dataframe

2013-03-07 Thread jim holtman
If you are just copying, why not: opdf <- tab On Thu, Mar 7, 2013 at 12:23 PM, Sahana Srinivasan < sahanasrinivasan...@gmail.com> wrote: > Hi, I am trying to create a data frame using the dimensions of another data > frame that I have input. This is the code I am using: > > tab is the data fra

[R] Copying a dataframe

2013-03-07 Thread Sahana Srinivasan
Hi, I am trying to create a data frame using the dimensions of another data frame that I have input. This is the code I am using: tab is the data frame that is input. c.leng<-length(tab[,1]); r.leng<-length(tab[1,]); opdf<-data.frame(ncol=c.leng, nrow=r.leng); a<-1; while(a<=c.leng) { opdf[[1]][a]