The short answer to your question is *don't* concatenate the values in the
row, then attempt to /rbind()/ them incrementally to a data.frame.  Instead
build each column separately inside the loop, then /cbind() (data.frame()/ 
does an implicit/ cbind()/ ) them together at the end.  Something like this:

/
lat.column <- c(length(100))
lon.column <- c(length(100))
...
for (i in 1:100){ 
 ...
  lat.column[i]  <- data[,7] # latitude 
  lon.column[i] <- data[,8] # longitude 
   ...
} 
my.data <- data.frame(lat.column, lon.column, ...)
/

-jm


--
View this message in context: 
http://r.789695.n4.nabble.com/save-output-of-loop-tp4386599p4387476.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to