Displaying 1 result from an estimated 1 matches for "subdata_ty".
2012 Sep 24
0
stop on rows where !is.na(mydata$ti_all)
...ed correctly")
} else {
print("trying to install plyr")
install.packages('plyr')
if(require(plyr)){
print("plyr installed and loaded")
} else {
stop("could not install plyr")
}
}
newrows <- ddply(mydata, .(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(subdata_ty) > 0) {
numbers = sapply(strsplit(subdata...