0

I have a .csv file on Pacific Ocean data that contains longitude and latitude information for coordinates. Ideally what I want to do is map the closest points by their longitude and latitude and set a range of some mileage proximity to each of the West Coast states, such as Washington, Oregon, and California. For example, I want all the latitude and longitude points that are within 100 miles of the Oregon coastline. Then I would tag these points as the Oregon points. How would I go about filtering the data like this? Also, I can not use the pipe operator.

I've tried a few different sf functions but I'm unsure how to proceed since most of the sf functions seem to be used for mapping.

  • 6
    Welcome to SO, Ashley Smith! Questions on SO (especially in R) do much better if they are reproducible and self-contained. By that I mean including attempted code (please be explicit about non-base packages), sample representative data (perhaps via `dput(head(x))` or building data programmatically (e.g., `data.frame(...)`), possibly stochastically), perhaps actual output (with verbatim errors/warnings) versus intended output. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans May 07 '23 at 20:51
  • 4
    Why can't you use the pipe operator? _Which_ pipe operator, there are two. Do you have other package constraints? (If you mean the `%>%` pipe, then does that mean you also cannot use the `dplyr` package? It would be rather odd to allow dplyr without the pipe.) – r2evans May 07 '23 at 20:51

0 Answers0