Skip to content
Back to formatted view

Raw Message

Message-ID: <4575DB14.5050705@web.de>
Date: 2006-12-05T20:48:20Z
From: Carmen Meier
Subject: bind  data.frames seperately

Hi to all,

I would like to bind data1 and data2 (both are coming from an Excel 
sheet) but only the data rows
using rbind will cause double names and value.
but I need only add the data.rows and the rest of the names and values 
should be NA

value.1=c("a","b","c","d",5:54)          # building similar data frame 
like from excel
for (i in 5:54) value.1[i] <- NA            #only to simulate the NAs 
for the example
value.2=c(1:54)
for (i in 5:54) value.2[i] <- NA

data1<-data.frame(names=value.1, value=value.2, 
data.row.1=c(1:54),data.row.2=c(1:54))

value.1=c("a","b","c","d",5:69)
for (i in 5:69) value.1[i] <- NA
value.2=c(1:69)
for (i in 5:69) value.2[i] <- NA

data2<-data.frame(names=value.1, value.2, 
data.row.1=c(1:69),data.row.2=c(1:69))

By the way: Why are the NAs from name are changing from NA to <NA> after 
the data.frame command?

Thank you for your help

Carmen