data("filteredGDP")
clubs <- findClubs(filteredGDP, dataCols=2:35, unit_names = 1, refCol=35, time_trim = 1/3,
cstar = 0, HACmethod = "FQSB")
### Plot transition paths for all clubs
plot(clubs)
plot(clubs, y_fixed=TRUE)
plot(clubs, nrows=2,ncols=4)
plot(clubs, ncols=3, lty='dotdash', lwd=3, col="blue")
plot(clubs, ncols=3, y_fixed=TRUE, lty='dotdash', lwd=3, col="blue")
### Plot transition paths only for some clubs
plot(clubs, clubs=c(2,4,5))
plot(clubs, nrows=1, ncols=3, clubs=c(2,4,5), avgTP = FALSE)
plot(clubs, nrows=1, ncols=3, clubs=c(2,4,5), avgTP = FALSE, legend=TRUE)
plot(clubs, clubs=c(2,4,5), avgTP_clubs = c(1,3))
plot(clubs, clubs=c(2,4,5), avgTP_clubs = c(1,3), legend=TRUE)
### Export customized plots
#Only plot average transition paths
plot(clubs, clubs=NULL, avgTP = TRUE, legend=TRUE)
#only lines, without markers and legend
plot(clubs, save = TRUE, filename ="name.pdf" , path = tempdir(), width = 15, height = 10)
#markers and legend (up to the fourth characther is shown)
plot(clubs, legend=TRUE, plot_args=list(type='o'),
legend_args=list(max_length_labels=4, y.intersp=1),
save = TRUE, filename ="name.pdf", path = tempdir(), width = 15, height = 10)
#for large samples the legend could be better displayed by plotting each club
#in turn and by increasing the plot dimension (through width and height)
plot(clubs, clubs=1, avgTP=FALSE, legend=TRUE, plot_args=list(type='o'),
legend_args=list(max_length_labels=8, y.intersp=1),
save = TRUE, filename ="name.pdf", path = tempdir(), width = 20, height = 15)
#customize x-labels - 1
plot(clubs, legend=TRUE, plot_args=list(type='o', xmarks=seq(1,34),xlabs=seq(1970,2003),
xlabs_dir=0), legend_args=list(max_length_labels=4, y.intersp=1),
save = TRUE, filename ="name.pdf" , path = tempdir(), width = 15, height = 10)
#customize x-labels - 2
plot(clubs, legend=TRUE, plot_args=list(type='o', xmarks=seq(1,34,1), xlabs=seq(1970,2003,1),
xlabs_dir=2), legend_args=list(max_length_labels=4, y.intersp=1),
save = TRUE, filename ="name.pdf" , path = tempdir(), width = 15, height = 10)
#show only the plot with the average transition paths of each club
plot(clubs, clubs=NULL, avgTP=TRUE, legend=TRUE,
plot_args=list(type='o', xmarks=seq(1,34), xlabs=seq(1970,2003), xlabs_dir=0),
save = TRUE, filename ="name.pdf" , path = tempdir(), width = 15, height = 10)
#markers and legend - png format
plot(clubs, legend=TRUE, plot_args=list(type='o'),
legend_args=list(max_length_labels=4, y.intersp=1),
save = TRUE, filename ="name.png" , path = tempdir(), width = 15, height = 10,
device= "png", res=100)
Run the code above in your browser using DataLab