Hi everybody,

I thought I was using the get() fn correctly here to loop over multiple
data frame names in an R for() loop. Can someone advise?


> miss<-c("#NULL!","999")
> d<-c("d1","d2","d3","d4")
>
> for(i in 1:4){
+
+ miss1<-ifelse(i<=2,miss[1],miss[2])
+ miss1
+
+ get(d[i])<-read.csv(paste("C:\\DATA\\Data\\Original\\",dsn[i],sep=""),
+ na.strings=c(miss1,"999999999"))
+
+ head(get(d[i]))
+
+ write.csv(get(d[i]),paste("C:\\DATA\\Data\\",dsn[i],sep=""),
+ na=".")
+
+ }
Error in get(d[i]) <- read.csv(paste("C:\\DATA\\Data\\Original\\", dsn[i],
:
  could not find function "get<-"
>

Thanks!

Dan

	[[alternative HTML version deleted]]

