如何用R制作Barplot

时间:2018-05-06 15:18:09

标签: r plot

我尝试用R制作一个条形图,我使用名为cmtn的数据集,但这不起作用。这是我使用的数据集:     dataset

这是代码:

x <- c(42012.8,36328.2,546.9,109.4,7123.3,80865.5,11133.3,1325.4,9214.5,9290.3)

names(x)=c("Importation","Exportation","Formation brute de capital","Impots 
sur production","valeur ajoutees ", "PIB","Production_secteur","Salaires"    
,"Credits","valeur_produits")

barplot(x,space = c(1.5), axisnames = FALSE,col = 
c("indianred","indianred1","indianred2","indianred3","salmon",
"salmon1","salmon ","salmon3","seagreen3","seagreen4"),main = "Commerce", 
font.main = 1)

0 个答案:

没有答案