[R] Windows7, latest R-Studio, newb, how to display 1 column name from a data frame.

Rod Meriwether rodmeriwether at gmail.com
Fri Feb 20 16:36:02 CET 2015


I'm supposed to return for class data with the ID and the value.
I'm returning just the correct value. Here's the code and the output.
 nobs <- data.frame()
  files_list <- list.files(directory, full.names=TRUE)
  dat <- data.frame()

  for (i in id){
     dat <- (read.csv(files_list[i]))

 nobs <-  sum(complete.cases(dat))
 print(nobs)

             }
}

The below values are correct, but I dont have the "id" in front of each
sum.
Any help?
 complete("specdata",c(2,4,8,10,12))
[1] 1041
[1] 474
[1] 192
[1] 148
[1] 96

	[[alternative HTML version deleted]]



More information about the R-help mailing list