Skip to content

Commit

Permalink
Merge pull request #839 from olivroy/error-msg
Browse files Browse the repository at this point in the history
Add unimplemented functions back + tweak v4 detection in tests
  • Loading branch information
mtennekes authored Feb 28, 2024
2 parents afbf4e8 + eb584fc commit 868985f
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 22 deletions.
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Type: Package
Package: tmap
Title: Thematic Maps
Version: 3.99.9000
Expand Down Expand Up @@ -48,7 +47,6 @@ Suggests:
av,
cartogram,
colorspace,
covr,
dplyr,
ggplot2,
gifski,
Expand Down
32 changes: 22 additions & 10 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Generated by roxygen2: do not edit by hand


if(getRversion() >= "3.6.0") {
S3method(knitr::knit_print, tmap)
} else {
export(knit_print.tmap)
}

if(getRversion() >= "3.6.0") {
S3method(knitr::knit_print, tmap_arrange)
} else {
export(knit_print.tmap_arrange)
}
S3method("+",tmap)
S3method(print,tm_element)
S3method(print,tm_shape)
Expand Down Expand Up @@ -93,6 +105,7 @@ export(make_by_vars)
export(marker_icon)
export(providers)
export(qtm)
export(renderTmap)
export(shapeTM)
export(theme_ps)
export(tm_add_legend)
Expand Down Expand Up @@ -144,7 +157,9 @@ export(tm_pos_auto_out)
export(tm_pos_in)
export(tm_pos_out)
export(tm_raster)
export(tm_remove_layer)
export(tm_rgb)
export(tm_rgba)
export(tm_scale)
export(tm_scale_bar)
export(tm_scale_bivariate)
Expand Down Expand Up @@ -175,6 +190,8 @@ export(tm_ylab)
export(tmapAddLayerOptions)
export(tmapGetShapeMeta1)
export(tmapGetShapeMeta2)
export(tmapOutput)
export(tmapProxy)
export(tmapShape)
export(tmapSplitShp)
export(tmapSubsetShp)
Expand All @@ -185,6 +202,7 @@ export(tmap_devel_mode)
export(tmap_format)
export(tmap_format_add)
export(tmap_grid)
export(tmap_grob)
export(tmap_icons)
export(tmap_last)
export(tmap_leaflet)
Expand All @@ -196,18 +214,11 @@ export(tmap_options_reset)
export(tmap_options_save)
export(tmap_save)
export(tmap_style)
export(tmap_style_catalog)
export(tmap_style_catalogue)
export(tmap_tip)
export(ttm)
export(ttmp)
if(getRversion() >= "3.6.0") {
S3method(knitr::knit_print, tmap)
} else {
export(knit_print.tmap)
}
if(getRversion() >= "3.6.0") {
S3method(knitr::knit_print, tmap_arrange)
} else {
export(knit_print.tmap_arrange)
}
import(classInt)
import(cols4all)
import(data.table)
Expand All @@ -233,6 +244,7 @@ importFrom(grDevices,dev.size)
importFrom(grDevices,png)
importFrom(grDevices,rgb)
importFrom(htmlwidgets,saveWidget)
importFrom(leaflet,providers)
importFrom(rlang,expr)
importFrom(rlang,missing_arg)
importFrom(utils,browseURL)
51 changes: 49 additions & 2 deletions R/v4-not-implemented.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#' These functions will be implemented soon
#' @export
#' @param ... Arguments
#' @name v4-not-yet
tm_squares <- function() {
tm_squares <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
Expand All @@ -16,11 +17,57 @@ tm_markers <- function() {
}
#' @export
#' @rdname v4-not-yet
tm_logo <- function() {
tm_logo <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tm_minimap <- function() {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tmap_grob <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tmapOutput <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tmapProxy <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
renderTmap <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tm_remove_layer <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tm_rgba <- function(...) {
.Deprecated(new = "tm_rgb()")
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tmap_tip <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tmap_style_catalog <- function(...) {
stop("Not yet implemented in v4")
}
#' @export
#' @rdname v4-not-yet
tmap_style_catalogue <- function(...) {
stop("Not yet implemented in v4")
}
34 changes: 32 additions & 2 deletions man/v4-not-yet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testing_aux_layers.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metro$pop2020_class = cut(metro$pop2020, breaks = c(.5, 1.5, 2.5, 5, 15, 40) * 1
Africa = World[World$continent == "Africa", ]
tmapV = substr(packageVersion("tmap"), 1, 1)
tmapV = ifelse(packageVersion("tmap") >= "3.4", "4", "3")
txt = function(x) print(grid::grid.text(x, gp = gpar(cex = 3)))
v3 = function(e) {
if (tmapV == "3") {
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_facet_vars.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ weather2 = split(weather1, 'time')
tmapV = substr(packageVersion("tmap"), 1, 1)
tmapV = ifelse(packageVersion("tmap") >= "3.4", "4", "3")
txt = function(x) print(grid::grid.text(x, gp = gpar(cex = 3)))
v3 = function(e) {
if (tmapV == "3") {
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_facetting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metro$pop2020_class = cut(metro$pop2020, breaks = c(.5, 1.5, 2.5, 5, 15, 40) * 1
Africa = World[World$continent == "Africa", ]
tmapV = substr(packageVersion("tmap"), 1, 1)
tmapV = ifelse(packageVersion("tmap") >= "3.4", "4", "3")
txt = function(x) print(grid::grid.text(x, gp = gpar(cex = 3)))
v3 = function(e) {
if (tmapV == "3") {
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_legends.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ metro$pop2020_class = cut(metro$pop2020, breaks = c(.5, 1.5, 2.5, 5, 15, 40) * 1
Africa = World[World$continent == "Africa", ]
tmapV = substr(packageVersion("tmap"), 1, 1)
tmapV = ifelse(packageVersion("tmap") >= "3.4", "4", "3")
txt = function(x) print(grid::grid.text(x, gp = gpar(cex = 3)))
v3 = function(e) {
if (tmapV == "3") {
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_scales.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ metro$pop2020_class = cut(metro$pop2020, breaks = c(.5, 1.5, 2.5, 5, 15, 40) * 1
Africa = World[World$continent == "Africa", ]
tmapV = substr(packageVersion("tmap"), 1, 1)
tmapV = ifelse(packageVersion("tmap") >= "3.4", "4", "3")
txt = function(x) print(grid::grid.text(x, gp = gpar(cex = 3)))
v3 = function(e) {
if (tmapV == "3") {
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_stars.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ weather1 = st_set_dimensions(merge(weather), names = c('longitude','latitude','t
weather2 = split(weather1, 'time')
tmapV = substr(packageVersion("tmap"), 1, 1)
tmapV = ifelse(packageVersion("tmap") >= "3.4", "4", "3")
txt = function(x) print(grid::grid.text(x, gp = gpar(cex = 3)))
v3 = function(e) {
if (tmapV == "3") {
Expand Down

0 comments on commit 868985f

Please sign in to comment.