Skip to content

Commit

Permalink
tweak to binding extracols in sf grids
Browse files Browse the repository at this point in the history
  • Loading branch information
jflowernet committed Jun 12, 2024
1 parent 54a26fc commit c3b9dfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/raster_to_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ras_to_grid <- function(spatial_grid, dat, matching_crs, meth, name, antimeridia
data.frame(temp_grid, .) %>%
sf::st_sf() %>%
{if(matching_crs) . else sf::st_transform(., sf::st_crs(spatial_grid))} %>%
{if(grid_has_extra_cols) cbind(., extra_cols) %>% dplyr::select(colnames(extra_cols), name) else .} %>%
{if(grid_has_extra_cols) cbind(., extra_cols) %>% dplyr::relocate(colnames(extra_cols), .before = 1) else .} %>%
sf::st_set_geometry("geometry")
}
}

0 comments on commit c3b9dfc

Please sign in to comment.