You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,21 @@
1
+
# version 1.0-15
2
+
3
+
*`plot.sf()`: `key.width` is sensitive to pointsize graphics parameter, `key.pos` can hold a second value in [0, 1] determining the relative position of the key in the available space; keys with factor levels suggest a proper size if they won't fit.
4
+
5
+
*`[<-.sf` fixes the `agr` attribute when it is broken; #2211
6
+
7
+
*`sf` objects get a new attribute, `.sf_namespace`, which forces loading the `sf` namespace when it has not been loaded so far, e.g. for proper printing or plotting of an `sf` object; #2212 by Mike Mahoney
8
+
9
+
*`distinct.sf` is type-safe for `sf` objects with zero rows; #2204
10
+
11
+
*`summarise.sf` raises an error if `.by` is given but no `across()` on the geometry; #2207
12
+
13
+
*`st_write()` matches fields on name first, than on position; this matters for formats that have pre-defined names, such as GPX; #2202
14
+
1
15
# version 1.0-14
2
16
17
+
* fix `plot.sf()` when using a key for multiple factor variables; #2196, #2195
18
+
3
19
* fix use of `as.numeric_version` in a test, for upcoming change in r-devel
4
20
5
21
* code tidy-ing: fix many lintr suggestions, thanks to Michael Chirico (#2181 - #2191)
#' @details the \code{st_cast} method for \code{sf} objects can only split geometries, e.g. cast \code{MULTIPOINT} into multiple \code{POINT} features. In case of splitting, attributes are repeated and a warning is issued when non-constant attributes are assigned to sub-geometries. To merge feature geometries and attribute values, use \link[sf:aggregate.sf]{aggregate} or \link[sf:tidyverse]{summarise}.
249
258
st_cast.sf=function(x, to, ..., warn=TRUE, do_split=TRUE) {
250
259
geom= st_cast(st_geometry(x), to, group_or_split=do_split)
Copy file name to clipboardExpand all lines: R/plot.R
+61-23Lines changed: 61 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
#' @param nbreaks number of colors breaks (ignored for \code{factor} or \code{character} variables)
12
12
#' @param breaks either a numeric vector with the actual breaks, or a name of a method accepted by the \code{style} argument of \link[classInt]{classIntervals}
13
13
#' @param max.plot integer; lower boundary to maximum number of attributes to plot; the default value (9) can be overriden by setting the global option \code{sf_max.plot}, e.g. \code{options(sf_max.plot=2)}
14
-
#' @param key.pos integer; side to plot a color key: 1 bottom, 2 left, 3 top, 4 right; set to \code{NULL} to omit key completely, 0 to only not plot the key, or -1 to select automatically. If multiple columns are plotted in a single function call by default no key is plotted and every submap is stretched individually; if a key is requested (and \code{col} is missing) all maps are colored according to a single key. Auto select depends on plot size, map aspect, and, if set, parameter \code{asp}.
14
+
#' @param key.pos numeric; side to plot a color key: 1 bottom, 2 left, 3 top, 4 right; set to \code{NULL} to omit key completely, 0 to only not plot the key, or -1 to select automatically. If multiple columns are plotted in a single function call by default no key is plotted and every submap is stretched individually; if a key is requested (and \code{col} is missing) all maps are colored according to a single key. Auto select depends on plot size, map aspect, and, if set, parameter \code{asp}. If it has lenght 2, the second value, ranging from 0 to 1, determines where the key is placed in the available space (default: 0.5, center).
15
15
#' @param key.width amount of space reserved for the key (incl. labels), thickness/width of the scale bar
16
16
#' @param key.length amount of space reserved for the key along its axis, length of the scale bar
17
17
#' @param pch plotting symbol
@@ -72,7 +72,7 @@
72
72
#' @export
73
73
plot.sf<-function(x, y, ..., main, pal=NULL, nbreaks=10, breaks="pretty",
#' @param i record selection, see \link{[.data.frame}
312
+
#' @param i record selection, see \link{[.data.frame}, or a \code{sf} object to work with the \code{op} argument
308
313
#' @param j variable selection, see \link{[.data.frame}
309
314
#' @param drop logical, default \code{FALSE}; if \code{TRUE} drop the geometry column and return a \code{data.frame}, else make the geometry sticky and return a \code{sf} object.
310
315
#' @param op function; geometrical binary predicate function to apply when \code{i} is a simple feature object
0 commit comments