# with non VMS data
x <- data.frame(
longitude = runif(1000, min = -150, max = -80),
latitude = runif(1000, min = 15, max = 35)
)
data("mx_inland")
x <- clean_land_points(x, mx_inland)
# using sample_dataset
data("sample_dataset", "mx_inland")
vms_cleaned <- vms_clean(sample_dataset)
vms_no_land <- clean_land_points(vms_cleaned, mx_inland)
# You can check the results by plotting the data
vms_cleaned_sf <- sf::st_as_sf(vms_cleaned, coords = c("longitude", "latitude"), crs = 4326)
vms_no_land_sf <- sf::st_as_sf(vms_no_land, coords = c("longitude", "latitude"), crs = 4326)
library(ggplot2)
ggplot(vms_cleaned_sf) +
geom_sf(col = "red") +
geom_sf(data = vms_no_land_sf, col = "black")
# in the provided example only few inland points are eliminated.
# There are more evident one within historical data.
Run the code above in your browser using DataLab