R Markdown
# Read in dataset
df<-read.csv("https://raw.githubusercontent.com/tuyenhavan/Sentinel-Data1/Dataset/Area.csv")
head(df)
## Classifier Cover Percent
## 1 MLC Agriculture 35.29
## 2 MLC Urban 2.97
## 3 MLC Forest 56.86
## 4 MLC Mining 3.33
## 5 MLC Water 1.56
## 6 ANN Agriculture 43.46
# Create a barplot
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.3.3
ggplot(data=df,aes(x=Cover,y=Percent,fill=Classifier)) +
geom_bar(stat = "identity",position = "dodge", show.legend = F) +theme_bw() +
facet_wrap(~Classifier) + xlab("Land Cover Types")

# Another barplot
ggplot(data=df,aes(x=Cover,y=Percent,fill=Classifier)) +
geom_bar(stat = "identity",position = "dodge", show.legend = T) +theme_bw() +xlab("Land Cover Types")

# flip
ggplot(data=df,aes(x=Cover,y=Percent,fill=Classifier)) +
geom_bar(stat = "identity",position = "dodge", show.legend = T) +theme_bw() +xlab("Land Cover Types") + coord_flip()
