[R] Copying rows in data frames

Ista Zahn istazahn at gmail.com
Tue Mar 19 13:01:44 CET 2013


show us the data.

On Tue, Mar 19, 2013 at 7:55 AM, Sahana Srinivasan
<sahanasrinivasan.91 at gmail.com> wrote:
> Hi,
> I'm trying to copy the first row of one data frame to another. This is the
> statement I am using :
>
> df2[1,]<-df1[1,];
>
> I have printed them out separately:
> df1[1,] = A C D E F
> But after copying:
> df2[1,] = 96 29 88 122 68
>
>
> Why isn't it copying? They are both data frames, and "as.character" isn't
> working either.
>
> Thanks for your input :)
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.



More information about the R-help mailing list