I have a dataframe in which some states are characterized by two variables. Briefly you can think of every row as a vector of (state,var1,var2). I want to map states using googleVis package. My approach is to use markers whose size and color represent var1 and var2 respectively. I can be able to only represent one variable using the following code:
require(googleVis)
map <- gvisGeoMap(df_by_state, locationvar = 'state',
numvar = 'var1',
options = list(dataMode = 'markers',
region = 'US'))
plot(map)
The above code generates a map with markers.
However the size and color of the marker both represent the SAME variable, var1. How can I proceed to represent var2 in the color of the markers while var1 is encoded in the size?
I was able to do it using gvisGeoChart instead
However, if you still know how to do it with gvisGeoMap, I will appreciate that.
Thank you