[R] What is wrong with m?

Spencer Graves spencer.graves at pdf.com
Fri Sep 19 20:10:35 CEST 2003


For "m[1] <- ..." to work, "m" must already be defined.  To fix this, 
execute "m <- rep(NA, index)" before your second "for" loop, and it 
should work. 

hope this helps. 
spencer graves

Anna Pryor wrote:

>I've been programming in one directory and recently switched to another 
>directory.  It appears that in doing so I've uncovered a problem.  My 
>environment was saving something so that my code would work and now I don't 
>know how to fix it.  I have the following bit of code:
>
>  for(i in 1:index){
>    indexList = lst[i]
>	for(j in 2:jobs-1){
>           indexList = c(indexList,lst[i+index*j])
>        }
>   saveList[i,] = indexList
>
>   }
>
>
>   for (i in 1:index){
>	m[i] = median(saveList[i,])
>
>}
>m
>
>In my new directory, I am getting the complaint that "object m is not found."  
>Does anyone know what that means?
>
>Anna
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>  
>




More information about the R-help mailing list