s-news
[Top] [All Lists]

Assignment in for loops

To: s-news@lists.biostat.wustl.edu
Subject: Assignment in for loops
From: "W. Bauer" <bauerwo@gmx.net>
Date: Wed, 25 Feb 2004 22:07:11 +0100
Dear all

I have a couple of large time series stored in a directory called "liqts". I would like to perform calculations on several of these time series. Normally, the following works without problem:

obj.list<-c("serA","serB")
for (obj.ind in 1:length(obj.list)){
      series<-get(obj.list[obj.ind],where="liqts")
      day.av<-aggregateSeries(series,by="days",FUN=mean)
}
But suddenly, I get the error messages

  1: Object "series" not found in frame 1 for permanent assignment (maybe assigned a `for'
   loop variable?)
  2: Object "obj.list" not found in frame 1 for permanent assignment (maybe assigned a
   `for' loop variable?)

What went wrong? Many thanks for advice,

W. Bauer
<Prev in Thread] Current Thread [Next in Thread>
  • Assignment in for loops, W. Bauer <=