Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
huizezhang-sherry committed Nov 16, 2023
1 parent f791261 commit cdab59e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 39 deletions.
37 changes: 0 additions & 37 deletions R/cubble-update.R

This file was deleted.

25 changes: 25 additions & 0 deletions R/sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,28 @@ make_spatial_sf <- function(x, sfc = NULL, crs, silent = FALSE) {
x$geometry <- sfc
x |> sf::st_as_sf() |> update_cubble()
}

#' Temporary update cubble if the sf class take precedent of cubble classes
#'
#' When the data is already a cubble object but need update on attributes
#' @param data,key,index,coords,... see \code{make_cubble}
#' @rdname update
#' @export
update_cubble <- function(data, key, index, coords, ...){

UseMethod("update_cubble")
}

#' @rdname update
#' @export
update_cubble.spatial_cubble_df <- function(data, key = NULL,
index = NULL, coords = NULL, ...){
is_cubble(data)
key <- key_vars(data)
index <- index_var(data)
coords <- coords(data)

data |> new_spatial_cubble(key = key, index = index, coords = coords)

}

4 changes: 2 additions & 2 deletions man/update.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cdab59e

Please sign in to comment.