## Preparing fake matrix
center = cbind(1:6, 1:6)
obs = cbind(1:6, 6:1, 1:6) #actual observations to be plot as a pie chart
nesting = rep(1:3, each = 2)
## data to be pie-charted
fakedata = cbind(nesting, center, obs)
colnames(fakedata) = c("Group","Lon","Lat","Slice1","Slice2","Slice3")
fakedata
## Producing KML - group pie slices according to color
Pies2GE(center = fakedata[, 2:3],
obs = fakedata[, 4:ncol(fakedata)],
nesting = fakedata[, 1],
goo = "Pies2GE_V1.kml",
nedges = 20,
orient = 0,
maxAlt = 1e4,
radius = 5e4)
## Producing KML - as before but also tweeking the shape / radius / height and color of each pie
Pies2GE(center = fakedata[, 2:3],
obs = fakedata[, 4:ncol(fakedata)],
nesting = 0,
goo = "Pies2GE_V2.kml",
nedges = c(3, 3, 4, 4, 20, 20),
orient = 0,
colors = topo.colors(ncol(obs)),
maxAlt = c(3e4, 3e4, 5e4, 5e4, 1e5, 1e5),
radius = c(3e4, 3e4, 4e4, 4e4, 5e4, 5e4))
## Producing KML - group pies according to external information (experimental)
Pies2GE(center = fakedata[, 2:3],
obs = fakedata[, 4:ncol(fakedata)],
nesting = fakedata[, 1],
goo = "Pies2GE_V1.kml",
nedges = 20,
orient = 0,
maxAlt = 1e4,
radius = 5e4)
Run the code above in your browser using DataLab