Displaying 1 result from an estimated 1 matches for "newrows2".
Did you mean:
newrows
2012 Sep 24
0
stop on rows where !is.na(mydata$ti_all)
...c)
new_cma_c = ifelse(new_cma_c == 0, NA, new_cma_c)
return(c(newname, NA, NA, NA, new_out_c, new_cma_c, new_c_n, NA))
}
})
# recombine and sort
colnames(newrows) = colnames(mydata)
newdata = rbind(mydata, newrows)
newdata = newdata[order(newdata$id), ]
mydata2 <- newdata
newrows2 <- ddply(mydata2, .(id), function(subdata) {
subdata_ty = subdata[!is.na(subdata$ty_all), ]
if (NROW(subdata) == 1) {
r = subdata[1, ]
c("v_001_arm_1", NA, NA, NA, NA, NA,
lookup$c_name[lookup$t_name == r$t_name], NA)
}
else if (NROW(...