Grokbase Groups R r-help January 2002
FAQ
I've had a question a few moments ago about how to create multiple
objects from multiple files within a loop. Thanks for the quick answers,

it worked with "assign", like this:

for(i in seq(1,nfn,1)){
fin<-paste("/home/klimet/patrick/LAEGEREN/NEBEL/FOGEVENT2000/",fn[i],sep="")

assign(paste("f", i, sep = ""), as.matrix(read.table(fin,skip=1)))
}

I've tried to use the same command for assigning NA's to missing values
(=-999) in each object created with above loop, like this:
for(i in seq(1,nfn,1)){
assign(paste("f", i, sep = "")[paste("f", i, sep = "") < -500.], NA)
}

This did not work, it created an error "invalid first argument"
I've also tried:
for(i in seq(1,nfn,1)){
paste("f", i, sep = "")[paste("f", i, sep = "") < -500.] <- NA
}


This also created an error. Any clues about how to handle this problem?
Thanks again,

Patrick



-------------- next part --------------
A non-text attachment was scrubbed...
Name: patrick.vcf
Type: text/x-vcard
Size: 339 bytes
Desc: Card for Patrick Buetzberger
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20020122/4e7d77e2/patrick.vcf

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
groupr-help @
categoriesr
postedJan 22, '02 at 5:36p
activeJan 23, '02 at 12:33p
posts4
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase