Re: [R] Copying rows in data frames

2013-03-19 Thread arun
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

Re: [R] Copying rows in data frames

2013-03-19 Thread arun
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

Re: [R] Copying rows in data frames

2013-03-19 Thread Sahana Srinivasan
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

Re: [R] Copying rows in data frames

2013-03-19 Thread arun
Hi, set.seed(25)  df1<- as.data.frame(matrix(sample(LETTERS[1:10],20,replace=TRUE),ncol=5),stringsAsFactors=FALSE)  df1 #  V1 V2 V3 V4 V5 #1  E  B  A  J  F #2  G  J  C  F  H #3  B  G  D  G  E #4  I  D  D  B  H  str(df1) #'data.frame':    4 obs. of  5 variables: # $ V1: chr  "E" "G" "B" "I" # $ V2:

Re: [R] Copying rows in data frames

2013-03-19 Thread Berend Hasselman
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

Re: [R] Copying rows in data frames

2013-03-19 Thread Sahana Srinivasan
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_

Re: [R] Copying rows in data frames

2013-03-19 Thread Ista Zahn
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,