服务热线
178 0020 3020
#R小组第三期作业1
M <- c("Jan", "Feb", "Mar", "Apr", "May", "Jun")
Revenue <- c(7, 12, 5, 20, 16, 10)
png(file= "R-03-01.png")
barplot(Revenue,
xlab = "Month",
ylab = "Revenue",
main = "Revenue chart",
col = "blue",
names.arg = M,
border = "red")
dev.off()
#R小组第三期作业2
M <- c("Jan", "Feb", "Mar", "Apr", "May", "Jun")
part1 <- c(2,4,1,6,5,2)
part2 <- c(2,5,2,7,6,2)
part3 <- c(3,3,1,7,5,6)
png(file= "R-03-02.png")
barplot(rbind(part1,part2,part3),
names.arg = M,
xlab = "Month",
ylab = "Revenue",
main = "Revenue chart",
col = c("yellow","orange", "red")
)
legend("topleft",c("part1","part2","part3"),fill = c("yellow","orange", "red"))
dev.off()
附件