Skip to content

Commit

Permalink
Merge pull request #34 from JoFrhwld/main
Browse files Browse the repository at this point in the history
merging in main
  • Loading branch information
JoFrhwld authored Sep 28, 2023
2 parents cf267f5 + c25e541 commit ccd0b66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/density_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sf_polygon_safely <- function(...){
c("There was a problem creating a polygon with {.fun sfheaders::sf_polygon}",
"i" = "Try examining the results of {.fun densityarea::density_polygons} with {.arg as_sf} set to {.val {FALSE}}.")
)
return(NULL)
return(tibble::tibble())
}
return(poly_result$result)
}
Expand Down Expand Up @@ -101,7 +101,7 @@ isolines_to_df <- function(isolines, probs, nameswap){
iso_df_to_sf <- function(iso_poly_df, xname, yname){

if(nrow(iso_poly_df) < 4){
return(NULL)
return(tibble::tibble())
}

iso_poly_df |>
Expand All @@ -118,7 +118,7 @@ iso_df_to_sf <- function(iso_poly_df, xname, yname){
) -> iso_poly_pieces

if(is.null(iso_poly_pieces)){
return(NULL)
return(tibble::tibble())
}

iso_poly_pieces |>
Expand Down Expand Up @@ -317,7 +317,7 @@ density_area <- function(x,
) ->
iso_poly_sf

if(!is.null(iso_poly_sf)){
if(nrow(iso_poly_sf) > 0){
iso_poly_sf |>
sf::st_sf() |>
dplyr::mutate(
Expand All @@ -332,7 +332,7 @@ density_area <- function(x,
}

}else{
area_poly <- NULL
area_poly <- tibble::tibble()
}

if (as_list) {
Expand Down

0 comments on commit ccd0b66

Please sign in to comment.