Description Usage Arguments Details Examples
The extract
function provides functionality for updating existing rasterly
objects.
1 2 3 4 5 | ## S3 method for class 'rasterly'
x[name]
## S3 replacement method for class 'rasterly'
x[name, ...] <- value
|
x |
Object from which to extract element(s) or in which to replace element(s). |
name |
Character. A literal string to be extracted from |
... |
(missing) or NULL. |
value |
values to replace; typically an array-like R object of a similar class as x. |
Available names:
Aggregation: "data", "mapping", "plot_width", "plot_height", "range", "x_range", "y_range", "xlim", "ylim", "aesthetics", "reduction_func", "glyph", "max_size", "group_by_data_table", "drop_data", "variable_check"
Display: "background", "color", "alpha", "span", "show_raster", "layout"
Set level
in ...
. level
is numeric used for specifing level of 'rasterly' object to modify;
default is 1 for the parent layer (rasterly()
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(rasterly)
r <- rasterly(
data = data.frame(x = 1:1e4, y = runif(1e4), category = sample(1:4, 1e4, replace = TRUE)),
mapping = aes(x = x, y = y)
) %>%
rasterly_points(xlim = c(1, 5000)) %>%
rasterly_points(
mapping = aes(x = x, y = y, color = category),
xlim = c(5001, 1e4)
)
r["mapping"]
r["xlim"]
# reassign parent `rasterly()` mapping
r["mapping"] <- aes(x = x, y = y, color = category)
r["mapping"]
# reassign all mapping systems
r["mapping", level = 1:length(r)] <- aes(x = x, y = y)
r["mapping"]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.