Grokbase Groups R r-help April 2009
FAQ
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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupr-help @
categoriesr
postedApr 15, '09 at 9:55p
activeApr 15, '09 at 10:22p
posts2
users2
websiter-project.org
irc#r

2 users in discussion

Duncan Murdoch: 1 post Greggallen: 1 post

People

Translate

site design / logo © 2021 Grokbase