comparison scripts_R/Metadata_subsetBLSM.R @ 91:d3e05cd49feb branch-tests

trying to plot wrt PLOSONE guidelines
author Maria Panteli <m.x.panteli@gmail.com>
date Mon, 02 Oct 2017 15:32:51 +0100
parents bde45ce0eeab
children
comparison
equal deleted inserted replaced
89:8a2d56880050 91:d3e05cd49feb
10 Arial <- Type1Font(family="Arial", metrics=c("ArialMT.afm","arial-BoldMT.afm","Arial-ItalicMT.afm", "Arial-BoldItalicMT.afm")) 10 Arial <- Type1Font(family="Arial", metrics=c("ArialMT.afm","arial-BoldMT.afm","Arial-ItalicMT.afm", "Arial-BoldItalicMT.afm"))
11 postscriptFonts(Arial=Arial) 11 postscriptFonts(Arial=Arial)
12 par(family="Arial") 12 par(family="Arial")
13 13
14 #pdf(file="data/country_distribution_BL.pdf") 14 #pdf(file="data/country_distribution_BL.pdf")
15 pdf(file="../data/results/country_distribution.pdf") 15 pdf(file="../data/results/country_distribution.pdf", pointsize=12, width=6, height=4)
16 PlotCountryCounts(df) 16 PlotCountryCounts(df)
17 dev.off() 17 dev.off()
18 postscript(file="../data/results/country_distribution.eps") 18 postscript(file="../data/results/country_distribution.eps", pointsize=12, width=6, height=4)
19 PlotCountryCounts(df) 19 PlotCountryCounts(df)
20 dev.off() 20 dev.off()
21 21
22 pdf(file="../data/results/year_distribution.pdf", width=6, height=4) 22 pdf(file="../data/results/year_distribution.pdf", width=6, height=4, pointsize=12)
23 PlotYearDistribution(df) 23 PlotYearDistribution(df)
24 dev.off() 24 dev.off()
25 postscript("../data/results/year_distribution.eps", width=10) 25 postscript("../data/results/year_distribution.eps", width=10, pointsize=12)
26 PlotYearDistribution(df) 26 PlotYearDistribution(df)
27 dev.off() 27 dev.off()
28 #PlotBarChart(df, cat="Year", ordercat="REGION", mincount=10) 28 #PlotBarChart(df, cat="Year", ordercat="REGION", mincount=10)
29 29
30 #pdf(file="data/language_distribution_BL.pdf") 30 #pdf(file="data/language_distribution_BL.pdf")
31 levels(df$Language)[which(levels(df$Language)=="Southwestern Caribbean Creole English")]="SouthW Carib. Creole English" 31 levels(df$Language)[which(levels(df$Language)=="Southwestern Caribbean Creole English")]="SouthW Carib. Creole English"
32 df$Language[which(df$Language=="Southwestern Caribbean Creole English")] = "SouthW Carib. Creole English" 32 df$Language[which(df$Language=="Southwestern Caribbean Creole English")] = "SouthW Carib. Creole English"
33 levels(df$Language)[which(levels(df$Language)=="Lesser Antillean Creole French")]="Lesser Antil. Creole French" 33 levels(df$Language)[which(levels(df$Language)=="Lesser Antillean Creole French")]="Lesser Antil. Creole French"
34 df$Language[which(df$Language=="Lesser Antillean Creole French")] = "Lesser Antil. Creole French" 34 df$Language[which(df$Language=="Lesser Antillean Creole French")] = "Lesser Antil. Creole French"
35 df$REGION[which(df$Country=="French Guiana")] = "South America" 35 df$REGION[which(df$Country=="French Guiana")] = "South America"
36 pdf(file="../data/results/language_distribution.pdf") 36 pdf(file="../data/results/language_distribution.pdf", pointsize=12)
37 PlotBarChart(df, cat="Language", ordercat="Region", mincount=10) 37 PlotBarChart(df, cat="Language", ordercat="Region", mincount=10)
38 dev.off() 38 dev.off()
39 postscript("../data/results/language_distribution.eps", width=8, height=10) 39 postscript("../data/results/language_distribution.eps", width=8, height=10, pointsize=12)
40 PlotBarChart(df, cat="Language", ordercat="Region", mincount=10) 40 PlotBarChart(df, cat="Language", ordercat="Region", mincount=10)
41 dev.off() 41 dev.off()
42 42
43 df = read.csv('../data/results/df_and_clusters.csv', header=T) 43 df = read.csv('../data/results/df_and_clusters.csv', header=T)
44 #PlotBarChart(df, cat="Clusters", ordercat="CountryLang", mincount=1,legend=F) 44 #PlotBarChart(df, cat="Clusters", ordercat="CountryLang", mincount=1,legend=F)
126 #g = g+guides(fill = guide_legend(title = "Region"))+theme(legend.position=c(.9,.8),legend.margin = unit(0, "cm"),legend.key.size = unit(0.3, "cm"),legend.title = element_text(size=10),legend.text = element_text(size=10)) 126 #g = g+guides(fill = guide_legend(title = "Region"))+theme(legend.position=c(.9,.8),legend.margin = unit(0, "cm"),legend.key.size = unit(0.3, "cm"),legend.title = element_text(size=10),legend.text = element_text(size=10))
127 #g = g+guides(fill = guide_legend(title = "Region"))+theme(legend.position="left",legend.margin = unit(0, "cm"),legend.key.size = unit(0.3, "cm"),legend.title = element_text(size=9),legend.text = element_text(size=9)) 127 #g = g+guides(fill = guide_legend(title = "Region"))+theme(legend.position="left",legend.margin = unit(0, "cm"),legend.key.size = unit(0.3, "cm"),legend.title = element_text(size=9),legend.text = element_text(size=9))
128 g = g+guides(fill = guide_legend(title = "Region"))+theme(legend.position="top",legend.title = element_text(size=9),legend.text = element_text(size=9)) 128 g = g+guides(fill = guide_legend(title = "Region"))+theme(legend.position="top",legend.title = element_text(size=9),legend.text = element_text(size=9))
129 g = g+theme(panel.border = element_rect(colour = "white"),strip.background=element_rect(fill="white"),strip.text.x = element_blank()) 129 g = g+theme(panel.border = element_rect(colour = "white"),strip.background=element_rect(fill="white"),strip.text.x = element_blank())
130 #g = g+theme(axis.text.y = element_text(colour = ddata$labels$col)) 130 #g = g+theme(axis.text.y = element_text(colour = ddata$labels$col))
131 ggsave('../data/results/clusters_top3.pdf',plot=g) 131 ggsave('../data/results/clusters_top3.pdf',plot=g, pointsize=12)
132 ggsave('../data/results/clusters_top3.eps',plot=g) 132 ggsave('../data/results/clusters_top3.eps',plot=g, pointsize=12)