Displaying 1 result from an estimated 1 matches for "5_lat4".
Did you mean:
1_lat4
2010 Feb 02
2
using rbind in a for loop
...ke 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=" ",file="data.dat",append=T)}
and what I got is even not close to what I want: many lines of empty and
whole bunch of numbers without line change.
How ca...