From 612e44a01c295c21d959ffca61ba7ee29bbaeb09 Mon Sep 17 00:00:00 2001 From: olivroy Date: Tue, 19 Sep 2023 09:00:06 -0400 Subject: [PATCH] corrections `last_tmap` to `tmap_last() + pkg width overflow and links. --- NEWS.md | 2 +- R/pkg.R | 36 +++++++++---------- R/tm_element.R | 2 +- .../legend_and_attributes_placement.R | 2 +- man/tmap-package.Rd | 36 +++++++++---------- man/tmap_last.Rd | 2 +- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/NEWS.md b/NEWS.md index e12e4679..50ea9c3f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -157,7 +157,7 @@ - added popup.vars to base layer functions - bounding box (argument bbox in tm_shape) working in view mode - geocode_OSM improved: a SpatialPointsDataFrame can now be returned -- last_map added, which retrieves the last produced map +- `tmap_last()` added, which retrieves the last produced map - crop_shape can also handle polygons as cropping area - append_data improved; the under and over coverage information can be retrieved with under_coverage and over_coverage - interpolate parameter added to tm_rasters diff --git a/R/pkg.R b/R/pkg.R index 4e5d88b7..98fd110c 100644 --- a/R/pkg.R +++ b/R/pkg.R @@ -7,14 +7,14 @@ #' @section Quick plotting method: #' \tabular{ll}{ #' [qtm()]\tab Plot a thematic map \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' @section Main plotting method: #' Shape specification: #' \tabular{ll}{ #' [tm_shape()]\tab Specify a shape object \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' Aesthetics base layers: @@ -38,13 +38,13 @@ #' [tm_markers()]\tab Create a layer of markers \cr #' [tm_iso()]\tab Create a layer of iso/contour lines \cr #' [tm_rgb()]\tab Create a raster layer of an image \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' Faceting (small multiples) #' \tabular{ll}{ #' [tm_facets()]\tab Define facets \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' Attributes: @@ -54,9 +54,9 @@ #' [tm_compass()]\tab Create a map compass \cr #' [tm_credits()]\tab Create a text for credits \cr #' [tm_logo()]\tab Create a logo \cr -#' `[tm_xlab] and [tm_ylab]`\tab Create axis labels \cr +#' [tm_xlab()] and [tm_ylab()]\tab Create axis labels \cr #' [tm_minimap()]\tab Create a minimap (view mode only) \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' Layout element: @@ -66,7 +66,7 @@ #' [tm_view()]\tab Configure the interactive view mode \cr #' [tm_style()]\tab Apply a predefined style \cr #' [tm_format()]\tab Apply a predefined format \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' Change options: @@ -75,13 +75,13 @@ #' [ttm()]\tab Toggle between the modes \cr #' [tmap_options()]\tab Set global tmap options (from [tm_layout()], [tm_view()], and a couple of others) \cr #' [tmap_style()]\tab Set the default style \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' Create icons: #' \tabular{ll}{ #' [tmap_icons()]\tab Specify icons for markers or proportional symbols \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' @@ -93,18 +93,18 @@ #' [tmap_animation()]\tab Create an animation \cr #' [tmap_arrange()]\tab Create small multiples of separate maps \cr #' [tmap_save()]\tab Save thematic maps (either as image or HTML file) \cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' @section Spatial datasets: #' \tabular{ll}{ -#' [World()]\tab World country data ([`sf`][`sf::sf`] object of polygons) \cr -#' [NLD_prov()]\tab Netherlands province data ([`sf`][`sf::sf`] object of polygons) \cr -#' [NLD_muni()]\tab Netherlands municipal data ([`sf`][`sf::sf`] object of polygons) \cr -#' [metro()]\tab Metropolitan areas ([`sf`][`sf::sf`] object of points) \cr -#' [rivers()]\tab Rivers ([`sf`][`sf::sf`] object of lines) \cr -#' [land()]\tab Global land cover ([`stars`][stars::st_as_stars()] object)\cr -#' --------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +#' [`World`]\tab World country data ([`sf`][`sf::sf`] object of polygons) \cr +#' [`NLD_prov`]\tab Netherlands province data ([`sf`][`sf::sf`] object of polygons) \cr +#' [`NLD_muni`]\tab Netherlands municipal data ([`sf`][`sf::sf`] object of polygons) \cr +#' [`metro`]\tab Metropolitan areas ([`sf`][`sf::sf`] object of points) \cr +#' [`rivers`]\tab Rivers ([`sf`][`sf::sf`] object of lines) \cr +#' [`land`]\tab Global land cover ([`stars`][stars::st_as_stars()] object)\cr +#' --------------------------- \tab ------------------------------------------- \cr #' } #' #' @author Martijn Tennekes \email{mtennekes@@gmail.com} @@ -113,6 +113,6 @@ #' @concept statistical maps #' @concept choropleth #' @concept bubble map -#' @seealso `vignette("tmap_sneek_peek")` +#' @seealso `vignette("tmap_sneek_peek")`, #' @references Tennekes, M., 2018, {tmap}: Thematic Maps in {R}, Journal of Statistical Software, 84(6), 1-39, \doi{10.18637/jss.v084.i06} "_PACKAGE" diff --git a/R/tm_element.R b/R/tm_element.R index e2ee59de..8aadeab9 100644 --- a/R/tm_element.R +++ b/R/tm_element.R @@ -39,7 +39,7 @@ tm_element_list_sel = function(tml, subclass) { #' Retrieve the last map to be modified or created #' -#' Retrieve the last map to be modified or created. Works in the same way as [ggplot2::last_plot()], although there is a difference: `last_map()` returns the last call instead of the stacked [`tmap-element`]s. +#' Retrieve the last map to be modified or created. Works in the same way as [ggplot2::last_plot()], although there is a difference: `tmap_last()` returns the last call instead of the stacked [`tmap-element`]s. #' #' @return call #' @export diff --git a/demo/tutorials/legend_and_attributes_placement.R b/demo/tutorials/legend_and_attributes_placement.R index 33e908a4..fb7a79b2 100644 --- a/demo/tutorials/legend_and_attributes_placement.R +++ b/demo/tutorials/legend_and_attributes_placement.R @@ -38,7 +38,7 @@ map + tm_layout(legend.position=c("center", "center"), # the normal position argument legend.position (together with legend.just) controls the position of the legend within the extra viewport # print this map in normal mode: -last_map() + tm_layout(design.mode=FALSE) +tmap_last() + tm_layout(design.mode=FALSE) # map attributes are controlled in a similar way diff --git a/man/tmap-package.Rd b/man/tmap-package.Rd index a4dff4fa..80787613 100644 --- a/man/tmap-package.Rd +++ b/man/tmap-package.Rd @@ -15,7 +15,7 @@ This page provides a brief overview of all package functions. See \code{vignette \tabular{ll}{ \code{\link[=qtm]{qtm()}}\tab Plot a thematic map \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } } @@ -24,7 +24,7 @@ This page provides a brief overview of all package functions. See \code{vignette Shape specification: \tabular{ll}{ \code{\link[=tm_shape]{tm_shape()}}\tab Specify a shape object \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } Aesthetics base layers: @@ -48,13 +48,13 @@ Aesthetics derived layers: \code{\link[=tm_markers]{tm_markers()}}\tab Create a layer of markers \cr \code{\link[=tm_iso]{tm_iso()}}\tab Create a layer of iso/contour lines \cr \code{\link[=tm_rgb]{tm_rgb()}}\tab Create a raster layer of an image \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } Faceting (small multiples) \tabular{ll}{ \code{\link[=tm_facets]{tm_facets()}}\tab Define facets \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } Attributes: @@ -64,9 +64,9 @@ Attributes: \code{\link[=tm_compass]{tm_compass()}}\tab Create a map compass \cr \code{\link[=tm_credits]{tm_credits()}}\tab Create a text for credits \cr \code{\link[=tm_logo]{tm_logo()}}\tab Create a logo \cr -\verb{[tm_xlab] and [tm_ylab]}\tab Create axis labels \cr +\code{\link[=tm_xlab]{tm_xlab()}} and \code{\link[=tm_ylab]{tm_ylab()}}\tab Create axis labels \cr \code{\link[=tm_minimap]{tm_minimap()}}\tab Create a minimap (view mode only) \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } Layout element: @@ -76,7 +76,7 @@ Layout element: \code{\link[=tm_view]{tm_view()}}\tab Configure the interactive view mode \cr \code{\link[=tm_style]{tm_style()}}\tab Apply a predefined style \cr \code{\link[=tm_format]{tm_format()}}\tab Apply a predefined format \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } Change options: @@ -85,13 +85,13 @@ Change options: \code{\link[=ttm]{ttm()}}\tab Toggle between the modes \cr \code{\link[=tmap_options]{tmap_options()}}\tab Set global tmap options (from \code{\link[=tm_layout]{tm_layout()}}, \code{\link[=tm_view]{tm_view()}}, and a couple of others) \cr \code{\link[=tmap_style]{tmap_style()}}\tab Set the default style \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } Create icons: \tabular{ll}{ \code{\link[=tmap_icons]{tmap_icons()}}\tab Specify icons for markers or proportional symbols \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } } @@ -104,20 +104,20 @@ Create icons: \code{\link[=tmap_animation]{tmap_animation()}}\tab Create an animation \cr \code{\link[=tmap_arrange]{tmap_arrange()}}\tab Create small multiples of separate maps \cr \code{\link[=tmap_save]{tmap_save()}}\tab Save thematic maps (either as image or HTML file) \cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +--------------------------- \tab ------------------------------------------- \cr } } \section{Spatial datasets}{ \tabular{ll}{ -\code{\link[=World]{World()}}\tab World country data (\code{\link[sf:sf]{sf}} object of polygons) \cr -\code{\link[=NLD_prov]{NLD_prov()}}\tab Netherlands province data (\code{\link[sf:sf]{sf}} object of polygons) \cr -\code{\link[=NLD_muni]{NLD_muni()}}\tab Netherlands municipal data (\code{\link[sf:sf]{sf}} object of polygons) \cr -\code{\link[=metro]{metro()}}\tab Metropolitan areas (\code{\link[sf:sf]{sf}} object of points) \cr -\code{\link[=rivers]{rivers()}}\tab Rivers (\code{\link[sf:sf]{sf}} object of lines) \cr -\code{\link[=land]{land()}}\tab Global land cover (\code{\link[stars:st_as_stars]{stars}} object)\cr ---------------------------- \tab --------------------------------------------------------------------------------------------------- \cr +\code{\link{World}}\tab World country data (\code{\link[sf:sf]{sf}} object of polygons) \cr +\code{\link{NLD_prov}}\tab Netherlands province data (\code{\link[sf:sf]{sf}} object of polygons) \cr +\code{\link{NLD_muni}}\tab Netherlands municipal data (\code{\link[sf:sf]{sf}} object of polygons) \cr +\code{\link{metro}}\tab Metropolitan areas (\code{\link[sf:sf]{sf}} object of points) \cr +\code{\link{rivers}}\tab Rivers (\code{\link[sf:sf]{sf}} object of lines) \cr +\code{\link{land}}\tab Global land cover (\code{\link[stars:st_as_stars]{stars}} object)\cr +--------------------------- \tab ------------------------------------------- \cr } } @@ -125,7 +125,7 @@ Create icons: Tennekes, M., 2018, {tmap}: Thematic Maps in {R}, Journal of Statistical Software, 84(6), 1-39, \doi{10.18637/jss.v084.i06} } \seealso{ -\code{vignette("tmap_sneek_peek")} +\code{vignette("tmap_sneek_peek")}, \url{https://r-tmap.github.io/tmap/} } \author{ Martijn Tennekes \email{mtennekes@gmail.com} diff --git a/man/tmap_last.Rd b/man/tmap_last.Rd index 24a64960..177f0a9c 100644 --- a/man/tmap_last.Rd +++ b/man/tmap_last.Rd @@ -10,7 +10,7 @@ tmap_last() call } \description{ -Retrieve the last map to be modified or created. Works in the same way as \code{\link[ggplot2:last_plot]{ggplot2::last_plot()}}, although there is a difference: \code{last_map()} returns the last call instead of the stacked \code{\link{tmap-element}}s. +Retrieve the last map to be modified or created. Works in the same way as \code{\link[ggplot2:last_plot]{ggplot2::last_plot()}}, although there is a difference: \code{tmap_last()} returns the last call instead of the stacked \code{\link{tmap-element}}s. } \seealso{ \code{\link[=tmap_save]{tmap_save()}}