Skip to content
Back to formatted view

Raw Message

Message-ID: <CA+vqiLG2V80a-R2eZd4rnEVzeCECessAXoLZEH2_GgmCnfuk_A@mail.gmail.com>
Date: 2013-03-19T12:01:44Z
From: Ista Zahn
Subject: Copying rows in data frames
In-Reply-To: <CACvtrYixajZHa_++OQM3PzZs-qcGdzzjdHeiY04px0B+P2m8Ow@mail.gmail.com>

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.