# NOT RUN {
# Set color constant
COLOR4 <- c("#e41a1c", "#377eb8", "#4daf4a", "#984ea3")
# Reduce the size of the data for for sake of example speed
set.seed(12345)
wind_reduced <- wind_sensit_2007[sample.int(nrow(wind_sensit_2007), 50), ]
sol42007 <- MonoClust(wind_reduced, cir.var = 3, nclusters = 4)
library(ggplot2)
ggpcp(data = wind_reduced,
circ.var = "WDIR",
# To improve aesthetics
rotate = pi*3/4-0.3,
order.appear = c("WDIR", "has.sensit", "WS"),
alpha = 0.5,
clustering = sol42007$membership,
medoids = sol42007$medoids,
cluster.col = COLOR4,
show.medoids = TRUE) +
theme(panel.background = element_rect(color = "white"),
panel.border = element_rect(color = "white", fill = NA),
panel.grid.major = element_line(color = "#f0f0f0"),
panel.grid.minor = element_blank(),
axis.line = element_line(color = "black"),
legend.key = element_rect(color = NA),
legend.position = "bottom",
legend.direction = "horizontal",
legend.title = element_text(face = "italic"),
legend.justification = "center")
# }
Run the code above in your browser using DataLab