Closed wolfeclw closed 4 years ago
would add_column()
suite your needs, with a disk_resolution = 6
to give you hexagons?
df <- capitals
df$z <- sample(1000:10000, size = nrow(df))
mapdeck(style = mapdeck_style("dark"), pitch = 45) %>%
add_column(
data = df
, lon = 'lon'
, lat = 'lat'
, elevation = "z"
, disk_resolution = 6
, layer_id = 'point'
, fill_colour = "country"
, tooltip = 'country'
)
Thats perfect! Sorry, I didn't see the add_column()
function in the examples and hadn't looked deeper in the documentation yet. Thanks!
I am trying to add a hexagon layer and control the height of the hexagons based on the value of a column in my data frame. The
elevation =
argument inadd_hexagon
andadd_pointcloud
seem to behave differently. I understand that the hexagon height is based on the density of points, but I thought that assigning a value toelevation
would override this?I am working with air pollution data from a mobile monitoring study. What I would like to do is create something like a spatial bar chart where every coordinate is a column and the height (and color) represent the value of the air pollution measurement. Essentially, I would like to create a layer that behaves like a pointcloud, but each coordinate is a column.
Below is an example of the different behavior. I expected the hexagon layer to behave like the pointcloud layer, but each capital is the same height and shown as a column.
Session info:
Thanks!