F G H I K L M N P Q R S T V W Y
A.K.
From: Sahana Srinivasan
To: arun
Sent: Tuesday, March 19, 2013 9:15 AM
Subject: Re: [R] Copying rows in data frames
Yes, I did want to copy the column names from the first data frame to the
secon
X18 X19 X20
#1 A C D E F G H I K L M N P Q R S T V W Y
A.K.
From: Sahana Srinivasan
To: arun
Sent: Tuesday, March 19, 2013 8:42 AM
Subject: Re: [R] Copying rows in data frames
This is the file I am reading in. The dput() comman
Sorry the result is long, the dimensions of the data frama are 4626x21. I
didn't know if I should truncate anything.
dput(head(df2))
structure(list(X1 = c("4626", NA, NA, NA, NA, NA), X2 = c("96",
NA, NA, NA, NA, NA), X3 = c("29", NA, NA, NA, NA, NA), X4 = c("88",
NA, NA, NA, NA, NA), X5 = c("12
quot;E" "H"
df2<-as.data.frame(matrix(NA,ncol=5,nrow=3))
df2[1,]<-df1[1,]
df2[1,]
# V1 V2 V3 V4 V5
#1 E B A J F
A.K.
- Original Message -
From: Sahana Srinivasan
To: r-help@r-project.org
Cc:
Sent: Tuesday, March 19, 2013 7:55 AM
Subject: [R] Copying rows
On 19-03-2013, at 13:06, Sahana Srinivasan
wrote:
> I.. did?
> Here is the whole thing:
>
> Output dataframe, df2: (NA is because I haven't filled those cells in yet,
> but they will have numeric values)
> 1462696298812268108381201091254781626868918410126662NANANANANANANANANANANANA
> NANANANAN
I.. did?
Here is the whole thing:
Output dataframe, df2: (NA is because I haven't filled those cells in yet,
but they will have numeric values)
1462696298812268108381201091254781626868918410126662NANANANANANANANANANANANA
NANANANANANANANANA
Input dataframe, df1:
1GENEACDEFGHIKLMNPQRSTVWY2amt:Amet_
show us the data.
On Tue, Mar 19, 2013 at 7:55 AM, Sahana Srinivasan
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,
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
8 matches
Mail list logo