Open glenncampagna opened 2 months ago
Map successful through roads layer (line 237 in fn_mapgen)
City points layer created with:
map <- map + new_scale("color") + new_scale("size") +
geom_point(data = labelsP[labelsP$class=="majC"|labelsP$class=="town",],
aes(x=lng, y=lat), color= colors_sf["citypts",], size=2)
Error:
Error in scale$guide == "none" :
comparison (==) is possible only for atomic and list types
A preview of labelsP[labelsP$class=="majC"|labelsP$class=="town",]
which is being plotted. Looks fine to me
class fontface fontfam angle bg.r segsize segcol colcode sizecode fillcode label lat lng
492 town plain sans 0 0.05 0.5 3 3 2 NA Annandale 38.83239 -77.19600
493 town plain sans 0 0.05 0.5 3 3 2 NA Ashburn 39.03016 -77.47115
494 town plain sans 0 0.05 0.5 3 3 2 NA Bailey's Crossroads 38.84773 -77.13053
495 town plain sans 0 0.05 0.5 3 3 2 NA Blacksburg 37.22994 -80.42768
496 town plain sans 0 0.05 0.5 3 3 2 NA Burke 38.77727 -77.26326
497 town plain sans 0 0.05 0.5 3 3 2 NA Cave Spring 37.22538 -80.00730
The color seems to be pulled correctly:
> colors_sf["citypts",]
[1] "black"
Warning that seems to be helpful:
The `guide` argument in `scale_*()` cannot be `FALSE`. This was deprecated in ggplot2 3.3.4.
ℹ Please use "none" instead.
Hey @glenncampagna thanks for pushing forward on this. Have you and @megpritch started collabing on this? Especially since there are errors it makes me think working with her version will save time in the long run, and you may be able to lend a hand with some of the challenges she's having very end of her process as well as testing the new routine for robustness. And who knows, maybe some of your errors will go away using her code.
fn_mapgen
since Meg has been working hard on that, and then using the improved function for WA maps will come directly after and will be a good test of the improvements made. I created an issue for the function itself for tracking changes and making sure we use it properly:Hey @glenncampagna and @megpritch -- for sure. And speaking to @gmahadwar we are in agreement that the maps for the case studies are a "nice to have", so anything that you can do to help Meg get the modularized function debugged and tested is a great contribution, and we don't have to spend any effort on getting the non-modularized version of the function working for WA right now.
1156
Function
Function call in WaterAvailability_CaseStudies.Rmd
A placeholder is currently used for the facilities/sources
mp_layer
because we don't want to map any facils/sources right nowThe above placeholder will not work and cause and error because it the data thats plotted (mp_layer_plot) ultimately becomes a blank dataframe because of this line in
fn_mapgen
:mp_layer_plot <- mp_layer[!mp_layer$bin == "X" , ]
[ ] Find alternative to
mp_layer
placeholder