I have dataframe coords_pa
with two columns(x=longitude, y = latitude).
For example:
coords_pa <-data.frame(x=c(35.75004,41.41671,67.41672,49.58338),y=c(63.58333,63.41666,38.75004, 54.58338))
How could I create new dataframe coords_pa_new
with two columns (x,y), but it will contain only coordinates with condition: x>40 and y>64?
I tried to find and succeed this task, but I do not know how to convert it in one dataframe:
kf = ifelse(coords_pa$y>64,1,0)
newdata = cbind(kf,coords_pa)
ff = ifelse(coords_pa$x>40,1,0)
newdata1 = cbind(ff,coords_pa)