Skip to content

Commit

Permalink
Manual corrections done
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Sep 18, 2023
1 parent c337b02 commit efb444e
Show file tree
Hide file tree
Showing 57 changed files with 181 additions and 169 deletions.
8 changes: 4 additions & 4 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' World and Netherlands map
#'
#' Maps of the world and the Netherlands (province and municipality level), class [sf::sf()]
#' Maps of the world and the Netherlands (province and municipality level), class [`sf`][`sf::sf`]
#'
#' The default projections for these maps are Eckhart IV (World) and Rijksdriehoekstelsel (Netherlands). See below. The projection can be changed temporarily for plotting purposes by using the projection argument of [tm_shape()].
#'
Expand Down Expand Up @@ -33,7 +33,7 @@ NULL

#' Spatial data of rivers
#'
#' Spatial data of rivers, of class [sf::sf()]
#' Spatial data of rivers, of class [`sf`][`sf::sf`]
#'
#' @usage data(rivers)
#' @name rivers
Expand All @@ -43,7 +43,7 @@ NULL

#' Spatial data of metropolitan areas
#'
#' Spatial data of metropolitan areas, of class [sf::sf()]. The data includes a population times series from 1950 to (forecasted) 2030. All metro areas with over 1 million inhabitants in 2010 are included.
#' Spatial data of metropolitan areas, of class [`sf`][`sf::sf`]. The data includes a population times series from 1950 to (forecasted) 2030. All metro areas with over 1 million inhabitants in 2010 are included.
#'
#' @usage data(metro)
#' @name metro
Expand All @@ -54,7 +54,7 @@ NULL

#' Spatial data of global land cover
#'
#' Spatial data of global land cover, percent tree cover, and elevation of class [`stars()`][stars::st_as_stars].
#' Spatial data of global land cover, percent tree cover, and elevation of class [`stars`][stars::st_as_stars()].
#' Two attributes in this object relates to global land cover.
#' The cover layer classifies the status of land cover of the whole globe into 20 categories, while
#' the cover_cls layer uses 8 simplified categories.
Expand Down
12 changes: 6 additions & 6 deletions R/pkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@
#'
#' @section Spatial datasets:
#' \tabular{ll}{
#' [World()]\tab World country data ([sf::sf()] object of polygons) \cr
#' [NLD_prov()]\tab Netherlands province data ([sf::sf()] object of polygons) \cr
#' [NLD_muni()]\tab Netherlands municipal data ([sf::sf()] object of polygons) \cr
#' [metro()]\tab Metropolitan areas ([sf::sf()] object of points) \cr
#' [rivers()]\tab Rivers ([sf::sf()] object of lines) \cr
#' [land()]\tab Global land cover ([`stars()`][stars::st_as_stars] object)\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
#' }
#'
Expand Down
4 changes: 2 additions & 2 deletions R/qtm.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
#'
#' @param shp One of
#' \itemize{
#' \item shape object, which is an object from a class defined by the [sf::sf()] or [`stars()`][stars::st_as_stars] package. Objects from the packages `sp` and `raster` are also supported, but discouraged.
#' \item shape object, which is an object from a class defined by the [`sf`][`sf::sf`] or [`stars`][stars::st_as_stars()] package. Objects from the packages `sp` and `raster` are also supported, but discouraged.
#' \item Not specified, i.e. `qtm()` is executed. In this case a plain interactive map is shown.
#' \item A OSM search string, e.g. `qtm("Amsterdam")`. In this case a plain interactive map is shown positioned according to the results of the search query (from OpenStreetMap nominatim)
#' }
#' @param fill,col,size,shape,lwd,lty,fill_alpha,col_alpha Visual variables.
#' @param by data variable name by which the data is split, or a vector of two variable names to split the data by two variables (where the first is used for the rows and the second for the columns). See also [tm_facets()]
#' @param scale numeric value that serves as the global scale parameter. All font sizes, symbol sizes, border widths, and line widths are controlled by this value. The parameters `symbols.size`, `text.size`, and `lines.lwd` can be scaled seperately with respectively `symbols.scale`, `text.scale`, and `lines.scale`. See also `...`.
#' @param title main title. For legend titles, use `X.style`, where X is the layer name (see `...`).
#' @param crs Either a [`crs()`][sf::st_crs] object or a character value (`PROJ.4` character string). By default, the projection is used that is defined in the `shp` object itself.
#' @param crs Either a [`crs`][sf::st_crs()] object or a character value (`PROJ.4` character string). By default, the projection is used that is defined in the `shp` object itself.
#' @param bbox bounding box. Arugment passed on to [tm_shape()]
#' @param basemaps name(s) of the provider or an URL of a tiled basemap. It is a shortcut to [tm_basemap()]. Set to `NULL` to disable basemaps. By default, it is set to the tmap option `basemaps`.
#' @param overlays name(s) of the provider or an URL of a tiled overlay map. It is a shortcut to [tm_tiles()].
Expand Down
2 changes: 1 addition & 1 deletion R/tm_components.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ tm_compass <- function(north,

#' Map component: scale bar
#'
#' Map component that adds a scale bar. As of version 4.0, `tm_scalebar` is used instead of `tm_scale_bar` (now deprecated), because of the potential confusion with the `tm_scale_x` scaling functions (like [tm_scale_continuous()]).
#' Map component that adds a scale bar. As of version 4.0, `tm_scalebar()` is used instead of `tm_scale_bar` (now deprecated), because of the potential confusion with the `tm_scale_x` scaling functions (like [tm_scale_continuous()]).
#'
#' @param breaks breaks
#' @param width width
Expand Down
2 changes: 1 addition & 1 deletion R/tm_element.R
Original file line number Diff line number Diff line change
Expand Up @@ -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`'s [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: `last_map()` returns the last call instead of the stacked [`tmap-element`]s.
#'
#' @return call
#' @export
Expand Down
8 changes: 4 additions & 4 deletions R/tm_facets.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Facets
#'
#' Specify facets. `tm_facets` is the core function, but recommended is to use `tm_facets_wrap`, `tm_facets_stack` or `tm_facets_grid`. The former two specify facets for one grouping variable (so one faceting dimension). The difference is that wrap may place facets in multiple rows and columns whereas `tm_facets_stack` stacks the facets either horizontally or vertically. `tm_facets_grid` supports up to three faceting dimensions.
#' Specify facets. `tm_facets()` is the core function, but recommended is to use `tm_facets_wrap()`, `tm_facets_stack()` or `tm_facets_grid()`. The former two specify facets for one grouping variable (so one faceting dimension). The difference is that wrap may place facets in multiple rows and columns whereas `tm_facets_stack()` stacks the facets either horizontally or vertically. `tm_facets_grid()` supports up to three faceting dimensions.
#'
#' @param by Group by variable (only for a facet wrap or facet stack)
#' @param rows Variable that specifies the rows (only for a facet grid)
Expand All @@ -16,11 +16,11 @@
#' @param drop.empty.facets Logical. If the `by` argument is specified, should empty facets be dropped? Empty facets occur when the `by`-variable contains unused levels. When `TRUE` and two `by`-variables are specified, empty rows and columns are dropped.
#' @param drop.NA.facets Logical. If the `by` argument is specified, and all data values for specific facets are missing, should these facets be dropped? `FALSE` by default.
#' @param sync Logical. Should the navigation in view mode (zooming and panning) be synchronized? By default `TRUE` if the facets have the same bounding box. This is generally the case when rasters are plotted, or when free.coords is `FALSE`.
#' @param showNA If the `by` argument is specified, should missing values of the `by`-variable be shown in a facet? If two `by`-variables are specified, should missing values be shown in an additional row and column? If `NA`, missing values only are shown if they exist. Similar to the `useNA` argument of [base::table()], where `TRUE`, `FALSE`, and `NA` correspond to `"always"`, `"no"`, and `"ifany"` respectively.
#' @param showNA If the `by` argument is specified, should missing values of the `by`-variable be shown in a facet? If two `by`-variables are specified, should missing values be shown in an additional row and column? If `NA`, missing values only are shown if they exist. Similar to the `useNA` argument of [table()][base::table()], where `TRUE`, `FALSE`, and `NA` correspond to `"always"`, `"no"`, and `"ifany"` respectively.
#' @param textNA Text used for facets of missing values.
#' @param scale.factor Number that determines how the elements (e.g. font sizes, symbol sizes, line widths) of the small multiples are scaled in relation to the scaling factor of the shapes. The elements are scaled to the `scale.factor`th root of the scaling factor of the shapes. So, for `scale.factor=1`, they are scaled proportional to the scaling of the shapes. Since elements, especially text, are often too small to read, a higher value is recommended. By default, `scale.factor=2`.
#' @param type `"grid"`, `"wrap"` or `"stack"`
#' @param along deceprated Please use `tm_facets_page`
#' @param along deceprated Please use `tm_facets_page()`
#' @export
#' @rdname tm_facets
#' @name tm_facets
Expand Down Expand Up @@ -104,7 +104,7 @@ tm_facets_grid = function(rows = NULL,

#' @export
#' @rdname tm_facets
#' @param ... paseed on to `tm_facets`
#' @param ... paseed on to `tm_facets()`
#' @name tm_facets_wrap
tm_facets_wrap = function(by = "VARS__",
nrows = NA,
Expand Down
8 changes: 4 additions & 4 deletions R/tm_layers_aux.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Map layer: basemap / overlay tiles
#'
#' Map layer that draws tiles from a tile server. The function `tm_basemap` draws the tile layer as basemap, i.e. as bottom layer. In contrast, `tm_tiles` draws the tile layer as overlay layer, where the stacking order corresponds with the order in which this layer is called, just like other map layers.
#' Map layer that draws tiles from a tile server. `tm_basemap()` draws the tile layer as basemap, i.e. as bottom layer. In contrast, `tm_tiles()` draws the tile layer as overlay layer, where the stacking order corresponds with the order in which this layer is called, just like other map layers.
#'
#' @param server Name of the provider or an URL. The list of available providers can be obtained with `providers` (tip: in RStudio, type `providers$` to see the options). See <https://leaflet-extras.github.io/leaflet-providers/preview/> for a preview of those. When a URL is provided, it should be in template format, e.g. \code{"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}. Use `NULL` in `tm_basemap` to disable basemaps.
#' @param server Name of the provider or an URL. The list of available providers can be obtained with `providers` (tip: in RStudio, type `providers$` to see the options). See <https://leaflet-extras.github.io/leaflet-providers/preview/> for a preview of those. When a URL is provided, it should be in template format, e.g. \code{"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}. Use `NULL` in `tm_basemap()` to disable basemaps.
#' @param alpha Transparency level
#' @param zoom Zoom level (only used in plot mode)
#' @param zindex zindex of the pane in view mode. By default, it is set to the layer number plus 400. By default, the tmap layers will therefore be placed in the custom panes `"tmap401"`, `"tmap402"`, etc., except for the base tile layers, which are placed in the standard `"tile"`. This parameter determines both the name of the pane and the z-index, which determines the pane order from bottom to top. For instance, if `zindex` is set to 500, the pane will be named `"tmap500"`.
Expand Down Expand Up @@ -55,7 +55,7 @@ tm_graticules = function(x = NA,

#' Coordinate grid / graticule lines
#'
#' Creates a [tmap-element()] that draws coordinate grid lines. It serves as a layer that can be drawn anywhere between other layers. By default, `tm_grid` draws horizontal and vertical lines acording to the coordinate system of the (master) shape object. Latitude and longitude graticules are drawn with `tm_graticules`.
#' Creates a [`tmap-element`] that draws coordinate grid lines. It serves as a layer that can be drawn anywhere between other layers. By default, `tm_grid()` draws horizontal and vertical lines acording to the coordinate system of the (master) shape object. Latitude and longitude graticules are drawn with `tm_graticules()`.
#'
#' @param x X coordinates for vertical grid lines. If `NA`, it is specified with a pretty scale and `n.x`.
#' @param y Y coordinates for horizontal grid lines. If `NA`, it is specified with a pretty scale and `n.y`.
Expand All @@ -76,7 +76,7 @@ tm_graticules = function(x = NA,
#' \item{scientific}{Should the labels be formatted scientifically? If so, square brackets are used, and the `format` of the numbers is `"g"`. Otherwise, `format="f"`, and `text.separator`, `text.less.than`, and `text.or.more` are used. Also, the numbers are automatically rounded to millions or billions if applicable.}
#' \item{format}{By default, `"f"`, i.e. the standard notation `xxx.xxx`, is used. If `scientific=TRUE` then `"g"`, which means that numbers are formatted scientifically, i.e. `n.dddE+nn` if needed to save space.}
#' \item{digits}{Number of digits after the decimal point if `format="f"`, and the number of significant digits otherwise.}
#' \item{...}{Other arguments passed on to [base::formatC()]}
#' \item{...}{Other arguments passed on to [formatC()]}
#' }
#' @param labels.cardinal Add the four cardinal directions (N, E, S, W) to the labels, instead of using negative coordinates for west and south (so it assumes that the coordinates are positive in the north-east direction).
#' @param labels.margin.x Margin between tick labels of x axis and the frame. Note that when `labels.inside.frame == FALSE` and `ticks == TRUE`, the ticks will be adjusted accordingly.
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_lines.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @param lwd,lwd.scale,lwd.legend,lwd.free Visual variable that determines the line width. See details.
#' @param lty,lty.scale,lty.legend,lty.free Visual variable that determines the line type. See details.
#' @param col_alpha,col_alpha.scale,col_alpha.legend,col_alpha.free Visual variable that determines the border color alpha transparency. See details.
#' @param linejoin,lineend line join and line end. See [grid::gpar()] for details.
#' @param linejoin,lineend line join and line end. See [gpar()][grid::gpar()] for details.
#' @param plot.order Specification in which order the spatial features are drawn. See [tm_plot_order()] for details.
#' @param trans.args,mapping.args lists that are passed on to internal transformation and mapping functions respectively
#' @param zindex Map layers are drawn on top of each other. The `zindex` numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_polygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @param lty,lty.scale,lty.legend,lty.free Visual variable that determines the line type. See details.
#' @param fill_alpha,fill_alpha.scale,fill_alpha.legend,fill_alpha.free Visual variable that determines the fill color alpha transparency See details.
#' @param col_alpha,col_alpha.scale,col_alpha.legend,col_alpha.free Visual variable that determines the border color alpha transparency. See details.
#' @param linejoin,lineend Line join and line end. See [grid::gpar()] for details.
#' @param linejoin,lineend Line join and line end. See [gpar()][grid::gpar()] for details.
#' @param plot.order Specification in which order the spatial features are drawn. See [tm_plot_order()] for details.
#' @param trans.args,mapping.args lists that are passed on to internal transformation and mapping functions respectively
#' @param zindex Map layers are drawn on top of each other. The `zindex` numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @param lty,lty.scale,lty.legend,lty.free Visual variable that determines the line type. See details.
#' @param fill_alpha,fill_alpha.scale,fill_alpha.legend,fill_alpha.free Visual variable that determines the fill color alpha transparency See details.
#' @param col_alpha,col_alpha.scale,col_alpha.legend,col_alpha.free Visual variable that determines the border color alpha transparency. See details.
#' @param linejoin,lineend line join and line end. See [grid::gpar()] for details.
#' @param linejoin,lineend line join and line end. See [gpar()][grid::gpar()] for details.
#' @param plot.order.list Specification in which order the spatial features are drawn. This consists of a list of three elementary geometry types: for polygons, lines and, points. For each of these types, which are drawn in that order, a [tm_plot_order()] is required.
#' @param trans.args.list,mapping.args.list lists that are passed on to internal transformation and mapping functions respectively. Each is a list of three items, named `polygons`, `lines`, and `points`. See [tm_polygons()], [tm_lines()], and [tm_dots()].
#' @param zindex Map layers are drawn on top of each other. The `zindex` numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.
Expand Down
Loading

0 comments on commit efb444e

Please sign in to comment.