# NOT RUN {
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"]
# }
Run the code above in your browser using DataLab