Skip to content

Commit

Permalink
fix #32
Browse files Browse the repository at this point in the history
  • Loading branch information
huizezhang-sherry committed Jul 9, 2024
1 parent 1d97e0c commit 57bdb92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

* fix the `st_transformation` on `spatial_cubble_df` (#32)

# cubble 0.3.2

* fix the conversion between cubble and stars object (#30)
Expand Down
5 changes: 4 additions & 1 deletion R/dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,10 @@ dplyr_row_slice.temporal_cubble_df <- function(data, i, ...){
dplyr_reconstruct.spatial_cubble_df <- function(data, template) {

if (!inherits(data, "tbl_df")) data <- as_tibble(data)
if (is_sf(template)) data <- sf::st_as_sf(data, crs = sf::st_crs(template))
if (is_sf(template)) {
new_crs <- data[[attr(template, "sf_column")]] |> sf::st_crs()
data <- sf::st_as_sf(data, crs = new_crs)
}

new_spatial_cubble(
data, key = key_vars(template),
Expand Down

0 comments on commit 57bdb92

Please sign in to comment.