-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combining data fields in scale_color_ #109
Comments
What you're trying to do is not (yet) supported in {rdeck}. Scales and accessors work on a single column (or field for tiles). Are you able to modify the tileset to add an additional (redundant) field? |
Correct, single-column visualizations are working nicely! But, for the tool I'm working on, I'd like to allow users to use a R Shiny interface to pick and choose columns to combine into their own composited variable for mapping -- like a dplry::mutate() statement after the accessor grabs the tiles within the viewing bounds and the vector attribute fields. Not sure I could pre-propulate the various combinations of the 50-some attribute columns, as I'd like to give the user's a lot of flexibility on how to do the compositing. I'm been slowly reading how R interfaces with javascript, and some other R mapping interfaces. If I find something that works, I'll report back here. Thanks. |
Closing the loop for anyone who comes across this thread... It's not based on rdeck or Deckgl, but I was able to use the R mapboxer package to access vector tiles and create composite variables based on multiple fields in the tiles. That package is basically an R interface to Mapbox GL JS, and thus involves creating list-like Mapbox GL JS style statements. The example below computes an average of two variables, and uses the result for a choropleth map. Since it's just a list, it can be constructed in R before calling add_layer, for example in R Shiny dynamically.
|
Hi,
Thanks for developing this package. It's amazing! I'm new to this, so forgive me for probably a simple question. I've been looking for more examples, and haven't come across what I need.
I'm trying to add two numeric data fields from my vector tile, and use the results in the color scaling function for the map. The code below works with just one data field (DM_W), but not when I try to combine two fields (e.g., DM_W + DM_A) as shown. Any suggestions would be appreciated.
I get an error...
From the ensym() error, I think it's expecting just a column name rather than an expression, but my R skills aren't good enough to come up with a work around.
The text was updated successfully, but these errors were encountered: