rasterly.Rd
Create a rasterly object, to which aggregation layers may be added. This function is the first step in the process
to generate raster image data using the rasterly
package.
rasterly( data = NULL, mapping = aes(), ..., plot_width = 600, plot_height = 600, x_range = NULL, y_range = NULL, background = "white", color = NULL, show_raster = TRUE, drop_data = FALSE, variable_check = FALSE )
data | Dataset to use for generating the plot. If not provided, data must be supplied in each layer of the plot. For best performance, particularly when processing large datasets, use of data.table is recommended. |
---|---|
mapping | Default list of aesthetic mappings to use for plot. The same with |
... | Other arguments which will be passed through to layers. |
plot_width | Integer. The width of the image to plot; must be a positive integer. A higher value indicates a higher resolution. |
plot_height | Integer. The height of the image to plot; must be a positive integer. A higher value indicates a higher resolution. |
x_range | Vector of type numeric. The range of |
y_range | Vector of type numeric. The range of |
background | Character. The background color of the image to plot. |
color | Vector of type character. It will determine this color vector is a
|
show_raster | Logical. Should the raster be displayed? |
drop_data | Logical. When working with large datasets, drops the original data once processed according to the provided
|
variable_check | Logical. If |
An environment wrapped by a list which defines the properties of the raster data to be generated.
The rasterly package currently supports five aesthetics via aes()
: x
, y
, on
, color
, and size
.
The "on" aesthetic specifies the variable upon which the reduction function should be applied to generate the raster data.
drop_data
can help save space, particularly when large datasets are used. However, dropping the original dataset
may result in errors when attempting to set or update aes()
parameters within rasterly layers.
Calling rasterly()
without providing rasterly_...()
layers has no effect.
More info can be found in README.md
rasterly_points, rasterly_build, [.rasterly, [<-.rasterly ggRasterly, plotRasterly
if (FALSE) { if(requireNamespace("data.table")) { url1 <- "https://raw.githubusercontent.com/plotly/datasets/master/uber-rides-data1.csv" ridesRaw_1 <- url1 %>% data.table::fread(stringsAsFactors = FALSE) url2 <- "https://raw.githubusercontent.com/plotly/datasets/master/uber-rides-data2.csv" ridesRaw_2 <- url2 %>% data.table::fread(stringsAsFactors = FALSE) url3 <- "https://raw.githubusercontent.com/plotly/datasets/master/uber-rides-data3.csv" ridesRaw_3 <- url3 %>% data.table::fread(stringsAsFactors = FALSE) ridesDf <- list(ridesRaw_1, ridesRaw_2, ridesRaw_3) %>% data.table::rbindlist() ridesDf %>% rasterly(mapping = aes(x = Lat, y = Lon)) %>% rasterly_points() }}