Thanks to everyone who helped me when I was totally clueless. Now I'm only
partially clueless, and in writing functions, which is major progress.
This is a function that is a major improvement over which I was using MS
Excel for:
function()
{
files <- list.files(pattern="ABN*") # All the models start with the letters
ABN
for( i in 1:length(files)) # loop through the files.
{
f <- files[i] # temporary variable
load(f) # Put the "abnmodel" object in this workspace
z <- predict(abnmodel, abndata) # use my student's data, and their various
models to predict with new data.
write(z, "output.txt", ncolumns = 11, append = TRUE, sep="\t") # Write the
output to a file for import into Excel.
}
}
This works great for PREPARING data for Excel, but I would rather not use
Excel.
The problem is that between the lines "Z <- predict" and "write(z, " I need
some more code, but I can't get it to work.
At the end of this function, I typically have 3,00 to 12,000 rows of data,
in which 10% to 33% are duplicates. I need to put the value z into
temporary storage, sort by the first column (if the first columns are
equal, the entire vector is an unwanted duplicate) test for equality, and
for each duplicate keep one, and discard the other(s).
Thanks for any help!
Gregg Allen
Not affiliated with any respectable organization.
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.