search for: 1_lat4

Displaying 1 result from an estimated 1 matches for "1_lat4".

Did you mean: 1_lat1
2010 Feb 02
2
using rbind in a for loop
*Dear R users, *I'm facing a trivial problem but I cannot solve it. My question is: I want to make data set like this. > i_lon1 i_lat1 i_lon2 i_lat2 i_lon3 i_lat3 i_lon4 i_lat4 > i+1_lon1 i+1_lat1 i+1_lon2 i+1_lat2 i+1_lon3 i+1_lat3 i+1_lon4 i+1_lat4 > i+2_lon1 i+2_lat1 i+2_lon2 i+2_lat2 i+2_lon3 i+2_lat3 i+2_lon4 i+2_lat4 . . . > i+5_lon1 i+5_lat1 i+5_lon2 i+5_lat2 i+5_lon3 i+5_lat3 i+5_lon4 i+5_lat4 My code is for (i in 1:5) { j <- which(!is.na(lat[i,])) p <- cbind(lon[i,j],lat[i,j]) cat(c(">",p),sep=" ",fi...