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]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.