a <- data.frame(squid=c(10,20,30),octopus=c(40,80,90),tuna=c(20,50,40))
#b <- seq(as.POSIXct(''),as.POSIXct('2000-03-01'),by='month'
rownames(a) <- paste(1:nrow(a),'月')
library(kableExtra)
kable(a)%>%kable_classic('striped',full_width=F)
|
squid
|
octopus
|
tuna
|
1 月 |
|
10|
|
40|
|
20|
|
2 月 |
|
20|
|
80|
|
50|
|
3 月 |
|
30|
|
90|
|
40|
|
aa=as.matrix(a)
barplot(aa[2,],col=rainbow(3),main=rownames(aa)[2],xlab='',ylab='百皿')
abline(h=seq(0,100,10),lty=1,col='gray')

barplot(aa,col = c("lightcyan","lightpink","lightyellow"),
main = "積上",
xlab = "",
ylab = "百皿")
abline(h = seq(0, 300, 50), lty = 20000, col = gray(0.5, 0.25))
legend("topleft", fill = c("lightcyan","lightpink","lightyellow"), legend = rownames(aa))

barplot(aa, col =c("lightcyan","lightpink","lightyellow"), beside = T,
main = "集合",
xlab = "",
ylab = "百皿")
abline(h = seq(0, 100, 10), lty = 5000, col = gray(0.5, 0.25))
legend("topleft", fill =c("lightcyan","lightpink","lightyellow"), legend = rownames(aa))
