Dear R-Community: I am assisting a community college instructor in an introductory statistics class.
He has asked me to do this: Read in a file, of filenames, line by line: Student_models.txt : (contains 1500+ filenames) ________________________ Experiment_name_student_name_date_time_Model_number_etc_etc Another_file_name_with_similar_info_as_above And_another And_another_one And_about_1500_more .......... .......... ________________________ function(filename)# I pass in filename { for(i in 1:length(filename)) { s <- filename[i,1] print(s) # I check the file name, and it is OK. load(s) # This returns all sorts of errors, most common is: object "mod" not found. .................. pred <- predict( s , test_vector) # I never get this far print(pred) write(filename, pred, "output.txt") ..... } The filenames are correct, and I can use "load(s)" interactively, but it won't work in a function. Thanks for ANY help!!!! Gregg Allen USA ______________________________________________ R-help@r-project.org mailing list 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.