Learn R Programming

plotGoogleMaps (version 2.0)

PolyCol: Create list of colors depending on attribute data.

Description

The function provide list of colors, unique colors, levels of attribute,attribute breaks.

Usage

PolyCol(attribute,
                     colPalette=NULL,
                     at=NULL)

Arguments

Value

The function provide list of colors (cols), unique colors (col.uniq), levels of attribute (att),attribute breaks (brks).

See Also

plotGoogleMaps, ellipseGoogleMaps, bubbleGoogleMaps

Examples

Run this code
# Data preparation
data(meuse)
coordinates(meuse)<-~x+y
proj4string(meuse) <- CRS('+init=epsg:28992')

m<-plotGoogleMaps(meuse,zcol='zinc',filename='myMap_z3.htm')
# see results in your working directory

# similar classic plot
cols=PolyCol(meuse$zinc)$cols
plot(meuse,col=cols)

str(PolyCol(meuse$zinc))

m<-plotGoogleMaps(meuse,zcol='zinc',at=c(0,300,600, max(meuse$zinc)), colPalette=rainbow(3), filename='myMap_z4.htm')
# similar classic plot
cols=PolyCol(meuse$zinc,colPalette=rainbow(3), at=c(0,300,600, max(meuse$zinc)) )$cols
plot(meuse,col=cols)

# plotKML(meuse, colour='zinc', colour_scale =cols)

Run the code above in your browser using DataLab