Value
A tibble
.
Examples
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
library(geobr)
#> Loading required namespace: sf
library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
data <- tibble(
latitude = get_brazil_state_latitude(),
longitude = get_brazil_state_longitude()
)
data
#> # A tibble: 27 × 2
#> latitude longitude
#> <dbl> <dbl>
#> 1 -9.98 -67.8
#> 2 -9.65 -35.7
#> 3 0.0402 -51.1
#> 4 -3.13 -60.0
#> 5 -13.0 -38.5
#> 6 -3.73 -38.5
#> 7 -15.8 -47.9
#> 8 -20.3 -40.3
#> 9 -16.7 -49.3
#> 10 -2.53 -44.3
#> # ℹ 17 more rows
geometry <- read_state(code = "SP") |> pull(geom)
#> Using year/date 2010
geometry |> st_bbox()
#> xmin ymin xmax ymax
#> -53.11011 -25.31232 -44.16137 -19.77989
filter_points_on_land(data, geometry)
#> # A tibble: 1 × 2
#> latitude longitude
#> <dbl> <dbl>
#> 1 -23.6 -46.6