Re: [R] Basic help on DF creation row by row

2013-10-02 Thread Rui Barradas
, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647 From: Rui Barradas To: rolf.kem...@renesas.com, Cc: r-help@r-project.org Date: 10/01/2013 08:38 PM Subject: Re: [R] Basic help on DF creation row by row Hello, The main pro

Re: [R] Basic help on DF creation row by row

2013-10-01 Thread Rui Barradas
Hello, The main problem is in the way you form newRow. You can't mix data classes in a vector created with c(), so all its elements become characters, the least common denominator: newRow <- c("primitiveSpace", 1.1 , "mm2") newRow [1] "primitiveSpace" "1.1""mm2" Then when you rb

Re: [R] Basic help on DF creation row by row

2013-10-01 Thread arun
Hi, Not sure if this helps. deviceSummary <- data.frame(item = character(0) ,  value = numeric(0) , unit = character(0) ,stringsAsFactors=FALSE) newlst<-  list("primitiveSpace",1.1,"mm2") deviceSummary[nrow(deviceSummary)+1,]<- newlst newlst2<-  list("primitiveSpace",2.2,"mm2")  deviceSummary[n