Skip to content

Commit

Permalink
check if x and y columns are present in addition to lat long
Browse files Browse the repository at this point in the history
  • Loading branch information
loreabad6 committed Jan 17, 2024
1 parent d2e4b60 commit b7aabc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ make_spatial_sf <- function(x, sfc = NULL, crs, silent = FALSE) {
stopifnot(is_cubble_spatial(x),
is.null(sfc) || inherits(sfc, "sfc"),
missing(crs) || inherits(crs, "crs"),
all(c("long", "lat") %in% names(x)))
all(c("long", "lat") %in% names(x)) || all(c("x", "y") %in% names(x)))
if (! requireNamespace("sf", quietly = TRUE))
stop("package sf required, please install it first")
if (is.null(sfc)) {
Expand Down

0 comments on commit b7aabc0

Please sign in to comment.