r - How can I find the frequency of a variable within Lat-Long bounds? -


all.lat     all.long    all.season 41.69000    -71.56639   jja 41.69000    -71.56639   mam 41.69000    -72.56639   mam 41.69000    -71.56639   mam 41.69000    -71.56639   jja 41.69000    -73.56639   mam 41.69000    -71.56639   son 41.69000    -73.56639   mam 41.69000    -71.56639   jja 41.69000    -74.56639   mam 42.86250    -71.95972   djf 42.86250    -75.95972   djf 42.94806    -71.46389   jja 42.94806    -71.46389   mam 42.94806    -71.46389   mam 42.84250    -71.70722   mam 42.84250    -71.70722   jja 42.94806    -75.46389   son 42.94806    -75.46389   djf 42.85750    -71.50667   mam   

so i'm basically, trying find frequency of seasons in range of lat-long.

basically, want mention 4 lat-long values (max , minimum values) , want find count of each season in bound.

intended output (just example):

djf = 5 son = 20 mam = 50 jja = 13 

i know how find frequency in r, i'm not sure how tie lat-long values.

enter image description here

assuming data frame called df , minima/maxima in minlat/maxlat/minlong/maxlong, should work:

sel <- which(all.lat <= maxlat & all.lat >= minlat &              all.long <= maxlong & all.long >= minlong) table(df$all.season[sel]) 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -