Skip to content
Prev 301618 / 398503 Next

Error in for-loop

Try this:  You had some 'indexing' problems.  You were accessing the
columns of the dataframe incorrectly.  You are also accessing 'list'
so you might want to review the Intro to R on indexing:
+ superior[[i]] <- 23+(datos.mx1[[i]]-23)*0.33;
+ inferior[[i]] <- 18+(datos.min[[i]]-18)*0.33;
+ }
+
+ LF[[i]] <- 1.26086956521739*superior[[i]]
+ LC[[i]] <- 0.722222222222222*inferior[[i]]
+ }
List of 6
 $ : NULL
 $ : NULL
 $ : num [1:1826] 21.1 21.7 23.5 23.5 23.7 ...
 $ : num [1:1826] 25.4 23.5 24.8 25 24.5 ...
 $ : num [1:1826] 23.3 24 24.7 24.7 24.9 ...
 $ : num [1:1826] 21.8 22.6 23.5 23.5 22.8 ...
List of 6
 $ : NULL
 $ : NULL
 $ : num [1:1826] 7.83 8.5 8.21 7.83 8.28 ...
 $ : num [1:1826] 9.07 9.76 8.54 8.07 9.35 ...
 $ : num [1:1826] 8.66 8.95 8.61 7.61 9.12 ...
 $ : num [1:1826] 8.07 8.69 8.07 7.85 8.23 ...
On Sun, Jul 29, 2012 at 9:59 AM, Domi <dominic.roye at gmail.com> wrote: