Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spatialplanr
Title: Help files for prioritzr Spatial Planning projects
Version: 0.7.5
Version: 0.7.6
Authors@R: c(
person(
given = "Jason D.",
Expand Down Expand Up @@ -43,9 +43,8 @@ Depends:
Imports:
assertthat,
dplyr,
forcats,
ggnewscale,
ggplot2,
ggplot2 (>= 4.0.0),
ggridges,
lifecycle,
magrittr,
Expand Down Expand Up @@ -73,4 +72,4 @@ Remotes:
github::prioritizr/wdpar,
github::ropensci/rnaturalearthhires
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
Config/roxygen2/version: 8.1.0
298 changes: 165 additions & 133 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,143 +40,175 @@ export(splnr_scale_01)
export(splnr_targets_byCategory)
export(splnr_targets_byIUCN)
export(splnr_targets_byInverseArea)
importFrom(assertthat,assert_that)
importFrom(assertthat,is.flag)
importFrom(assertthat,is.string)
importFrom(dplyr,across)
importFrom(dplyr,all_of)
importFrom(dplyr,any_of)
importFrom(dplyr,arrange)
importFrom(dplyr,as_tibble)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,coalesce)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,if_else)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,pull)
importFrom(dplyr,rename)
importFrom(dplyr,rename_at)
importFrom(dplyr,rename_with)
importFrom(dplyr,row_number)
importFrom(dplyr,rowwise)
importFrom(dplyr,select)
importFrom(dplyr,starts_with)
importFrom(dplyr,summarise)
importFrom(dplyr,summarize)
importFrom(dplyr,tibble)
importFrom(dplyr,ungroup)
importFrom(ggnewscale,new_scale_colour)
importFrom(ggnewscale,new_scale_fill)
importFrom(ggplot2,aes)
importFrom(ggplot2,annotate)
importFrom(ggplot2,coord_polar)
importFrom(ggplot2,coord_sf)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_line)
importFrom(ggplot2,element_rect)
importFrom(ggplot2,element_text)
importFrom(ggplot2,geom_abline)
importFrom(ggplot2,geom_bar)
importFrom(ggplot2,geom_segment)
importFrom(ggplot2,geom_sf)
importFrom(ggplot2,geom_text)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,guide_axis)
importFrom(ggplot2,guide_colourbar)
importFrom(ggplot2,guide_legend)
importFrom(ggplot2,guides)
importFrom(ggplot2,labs)
importFrom(ggplot2,scale_fill_brewer)
importFrom(ggplot2,scale_fill_distiller)
importFrom(ggplot2,scale_fill_gradient)
importFrom(ggplot2,scale_fill_gradient2)
importFrom(ggplot2,scale_fill_manual)
importFrom(ggplot2,scale_fill_viridis_c)
importFrom(ggplot2,scale_linetype_manual)
importFrom(ggplot2,scale_x_continuous)
importFrom(ggplot2,scale_x_discrete)
importFrom(ggplot2,scale_y_continuous)
importFrom(ggplot2,scale_y_discrete)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_bw)
importFrom(ggplot2,theme_minimal)
importFrom(ggplot2,unit)
importFrom(ggplot2,ylim)
importFrom(assertthat,
assert_that,
is.flag,
is.string
)
importFrom(dplyr,
across,
all_of,
any_of,
arrange,
as_tibble,
bind_cols,
bind_rows,
case_when,
coalesce,
everything,
filter,
group_by,
if_else,
left_join,
mutate,
pull,
rename,
rename_at,
rename_with,
row_number,
rowwise,
select,
starts_with,
summarise,
summarize,
tibble,
ungroup
)
importFrom(ggnewscale,
new_scale_colour,
new_scale_fill
)
importFrom(ggplot2,
aes,
annotate,
coord_polar,
coord_sf,
element_blank,
element_line,
element_rect,
element_text,
geom_abline,
geom_bar,
geom_segment,
geom_sf,
geom_text,
ggplot,
guide_axis,
guide_colourbar,
guide_legend,
guides,
labs,
scale_fill_brewer,
scale_fill_distiller,
scale_fill_gradient,
scale_fill_gradient2,
scale_fill_manual,
scale_fill_viridis_c,
scale_linetype_manual,
scale_x_continuous,
scale_x_discrete,
scale_y_continuous,
scale_y_discrete,
theme,
theme_bw,
theme_minimal,
unit,
ylim
)
importFrom(grid,unit)
importFrom(lifecycle,deprecate_warn)
importFrom(lifecycle,deprecated)
importFrom(lifecycle,
deprecate_warn,
deprecated
)
importFrom(magrittr,"%>%")
importFrom(prioritizr,add_binary_decisions)
importFrom(prioritizr,add_cuts_portfolio)
importFrom(prioritizr,add_default_solver)
importFrom(prioritizr,add_min_set_objective)
importFrom(prioritizr,add_relative_targets)
importFrom(prioritizr,eval_feature_representation_summary)
importFrom(prioritizr,eval_ferrier_importance)
importFrom(prioritizr,eval_rare_richness_importance)
importFrom(prioritizr,eval_replacement_importance)
importFrom(prioritizr,problem)
importFrom(prioritizr,solve.ConservationProblem)
importFrom(prioritizr,zones)
importFrom(purrr,map)
importFrom(purrr,map_dbl)
importFrom(purrr,map_df)
importFrom(purrr,map_lgl)
importFrom(purrr,map_vec)
importFrom(prioritizr,
add_binary_decisions,
add_cuts_portfolio,
add_default_solver,
add_min_set_objective,
add_relative_targets,
eval_feature_representation_summary,
eval_ferrier_importance,
eval_rare_richness_importance,
eval_replacement_importance,
problem,
solve.ConservationProblem,
zones
)
importFrom(purrr,
map,
map_dbl,
map_df,
map_lgl,
map_vec
)
importFrom(rappdirs,user_data_dir)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(rlang,sym)
importFrom(rnaturalearth,ne_coastline)
importFrom(rnaturalearth,ne_download)
importFrom(rlang,
":=",
.data,
sym
)
importFrom(rnaturalearth,
ne_coastline,
ne_download
)
importFrom(scales,squish)
importFrom(sf,st_area)
importFrom(sf,st_as_sf)
importFrom(sf,st_bbox)
importFrom(sf,st_centroid)
importFrom(sf,st_coordinates)
importFrom(sf,st_crs)
importFrom(sf,st_distance)
importFrom(sf,st_drop_geometry)
importFrom(sf,st_geometry)
importFrom(sf,st_nearest_feature)
importFrom(sf,st_polygon)
importFrom(sf,st_set_crs)
importFrom(sf,st_set_geometry)
importFrom(sf,st_sf)
importFrom(sf,st_sfc)
importFrom(sf,st_transform)
importFrom(sf,st_union)
importFrom(sf,
st_area,
st_as_sf,
st_bbox,
st_centroid,
st_coordinates,
st_crs,
st_distance,
st_drop_geometry,
st_geometry,
st_nearest_feature,
st_polygon,
st_set_crs,
st_set_geometry,
st_sf,
st_sfc,
st_transform,
st_union
)
importFrom(spatialgridr,get_data_in_grid)
importFrom(stats,na.omit)
importFrom(stats,quantile)
importFrom(stats,reorder)
importFrom(stats,setNames)
importFrom(stringr,str_c)
importFrom(stringr,str_pad)
importFrom(stringr,str_remove_all)
importFrom(stringr,str_replace_all)
importFrom(stringr,str_subset)
importFrom(tibble,as_tibble)
importFrom(tibble,deframe)
importFrom(tibble,enframe)
importFrom(tibble,rowid_to_column)
importFrom(tibble,tibble)
importFrom(tibble,tribble)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(tidyr,replace_na)
importFrom(tidyselect,all_of)
importFrom(tidyselect,any_of)
importFrom(tidyselect,everything)
importFrom(tidyselect,starts_with)
importFrom(tidyselect,where)
importFrom(units,drop_units)
importFrom(units,set_units)
importFrom(stats,
na.omit,
quantile,
reorder,
setNames
)
importFrom(stringr,
str_c,
str_pad,
str_remove_all,
str_replace_all,
str_subset
)
importFrom(tibble,
as_tibble,
deframe,
enframe,
rowid_to_column,
tibble,
tribble
)
importFrom(tidyr,
pivot_longer,
pivot_wider,
replace_na
)
importFrom(tidyselect,
all_of,
any_of,
everything,
starts_with,
where
)
importFrom(units,
drop_units,
set_units
)
importFrom(vctrs,vec_c)
importFrom(withr,with_options)
2 changes: 1 addition & 1 deletion R/splnr_featureRep.R
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ splnr_plot_featureRep <- function(df,
legend.title = ggplot2::element_blank(),
legend.position = "top",
legend.direction = "horizontal",
legend.background = ggplot2::element_rect(fill = "NA"),
legend.background = ggplot2::element_rect(fill = "transparent", colour = NA),
...
)

Expand Down
8 changes: 7 additions & 1 deletion R/splnr_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,15 @@ splnr_plot <- function(df,
ggplot2::scale_fill_viridis_c(name = legendTitle, aesthetics = c("colour", "fill")) +
# Configure guides to show color bar for fill and hide color legend for outline.
ggplot2::guides(
fill = ggplot2::guide_colourbar(order = 1),
fill = ggplot2::guide_colourbar(
order = 1,
title.position = "right",
title.hjust = 0.5,
title.theme = ggplot2::element_text(angle = -90)
),
colour = "none"
)

} else if (is.null(colNames)) { # If no column to plot by (only planning unit outlines).

# Add geom_sf to display planning unit outlines without fill.
Expand Down
Loading
Loading