Skip to content

Commit

Permalink
feat: remove all deprecated functions and args
Browse files Browse the repository at this point in the history
  • Loading branch information
rCarto committed Jan 6, 2025
1 parent 6bbd3bc commit 7478e88
Show file tree
Hide file tree
Showing 24 changed files with 12 additions and 952 deletions.
6 changes: 0 additions & 6 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ export(mf_inset_on)
export(mf_label)
export(mf_layout)
export(mf_legend)
export(mf_legend_c)
export(mf_legend_gl)
export(mf_legend_p)
export(mf_legend_pl)
export(mf_legend_s)
export(mf_legend_t)
export(mf_map)
export(mf_prop)
export(mf_prop_choro)
Expand Down
9 changes: 1 addition & 8 deletions R/mf_arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#' @param adj adjust the postion of the north arrow in x and y directions
#' @param align object of class \code{sf} or \code{sfc} used to adjust the
#' arrow to the real north
#' @param adjust deprecated, see align
#' @importFrom sf st_crs st_as_sf st_coordinates st_transform
#' @return No return value, a north arrow is displayed.
#' @export
Expand All @@ -18,14 +17,8 @@
mf_arrow <- function(pos = "topleft", col = getOption("mapsf.fg"),
cex = 1,
adj = c(0, 0),
align, adjust) {
align) {
test_cur_plot()
if (!missing(adjust)) {
warning(paste0("'adjust' is deprecated.\nUse 'align' instead."),
call. = FALSE
)
align <- adjust
}

if (missing(col)) {
col <- getOption("mapsf.fg")
Expand Down
22 changes: 1 addition & 21 deletions R/mf_export.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
#' @param x object of class \code{sf}, \code{sfc} or \code{SpatRaster}
#' @param expandBB fractional values to expand the bounding box with, in each
#' direction (bottom, left, top, right)
#' @param theme apply a theme (deprecated)
#' @param filename path to the exported file. If the file extention is ".png" a
#' png graphic device is opened, if the file extension is ".svg" a svg graphic
#' device is opened.
#' @param export deprecated
#' @param width width of the figure (pixels for png, inches for svg)
#' @param height height of the figure (pixels for png, inches for svg)
#' @param res resolution (for png)
Expand All @@ -36,25 +34,7 @@ mf_export <- function(x,
height,
res = 96,
...,
expandBB = rep(0, 4),
theme,
export = "png") {
# deprecated args mgmt
if (!missing(theme)) {
warning(
paste0(
"'theme' is deprecated.\n",
"In the next version of mapsf the current theme ",
"will be applied to the export."
),
call. = FALSE
)
mf_theme(theme)
}
if (!missing(export)) {
message('"export" is deprecated.')
}

expandBB = rep(0, 4)) {
# input test
if (!inherits(x, c("bbox", "SpatVector", "SpatRaster", "sf", "sfc", "sfg"))) {
stop(
Expand Down
15 changes: 2 additions & 13 deletions R/mf_init.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#' @param x object of class \code{sf}, \code{sfc} or \code{SpatRaster}
#' @param expandBB fractional values to expand the bounding box with, in each
#' direction (bottom, left, top, right)
#' @param theme apply a theme (deprecated)
#' @export
#' @keywords internal
#' @importFrom sf st_bbox st_as_sfc st_geometry st_crs<-
Expand All @@ -17,18 +16,8 @@
#' target <- mtq[30, ]
#' mf_init(target)
#' mf_map(mtq, add = TRUE)
mf_init <- function(x, expandBB = rep(0, 4), theme) {
if (!missing(theme)) {
warning(
paste0(
"'theme' is deprecated.\n",
"In the next version of mapsf the current theme ",
"will be applied."
),
call. = FALSE
)
mf_theme(theme)
}
mf_init <- function(x, expandBB = rep(0, 4)) {

bgmap <- getOption("mapsf.bg")

if (inherits(x, "SpatRaster")) {
Expand Down
63 changes: 0 additions & 63 deletions R/mf_leg_c.R

This file was deleted.

56 changes: 0 additions & 56 deletions R/mf_leg_gl.R

This file was deleted.

67 changes: 0 additions & 67 deletions R/mf_leg_p.R

This file was deleted.

58 changes: 0 additions & 58 deletions R/mf_leg_pl.R

This file was deleted.

Loading

0 comments on commit 7478e88

Please sign in to comment.