R - Set color variables of a bubble chart

253 views Asked by At

how to change the color of the bubble depending on a factor variable? My code is the following:

library(googleVis)
motion <- gvisMotionChart(temp1,
                      idvar="Location",
                      timevar="Year",
                      xvar = "Population_thousand", yvar = "AvgHouseholdDisposableIncome",
                      colorvar = "Country",
                      sizevar = "BubbleSize",
                      options=list(height = 620, width = 1280))
plot(motion)

Today the colors are not nice and I would like to put nicer colors depending on the country.

enter image description here

0

There are 0 answers