. . , .
slices<-c(10,13,18,9,7,13,12,14,11,8,15,15)
pct <- round(slices/sum(slices)*100)
lbls <- c("US","UK","Germany","China", "Malaysia", "Others","US","UK","Germany","China", "Malaysia", "Others")
lbls <- paste(lbls,"%",sep="")
lbls <- paste(lbls, pct)
col <- c("yellow", "orange", "red", "purple", "blue", "green", "yellow", "orange", "red", "purple", "blue", "green")
pie(slices,labels = lbls, main="Pie Chart of Countries", col = col)
col
col <- rep(c("yellow", "orange", "red", "purple", "blue", "green"),2)
, . 50% , :
a <- c(7, 9, 12, 6, 5, 9)
a2 <- (a/sum(a)) * 50
a2
b <- c(8, 10, 8, 6, 10, 10)
b2 <- (b/sum(b)) * 50
b2
pct <- round(c(a2,b2),2)
pct