Простое базовое решение R:
p1 <- as.matrix(prop.table(table(data$status))) * 100
p2 <- as.matrix(prop.table(table(data$Type))) * 100
op <- par(mfrow=c(1,2), las=1, mar=c(3,4,1,0))
barplot(p1, legend=TRUE, names="status", ylab="Percent")
barplot(p2, legend=TRUE, names="Type")
par(op)
![enter image description here](https://i.stack.imgur.com/MNdzJ.png)
data <- data.frame(id=1:10,
status=c("P","F","F","P","F","P","P","F","P","P"),
Type=c("full","full","full","part","part","full","full","part","part","full"))
data
id status Type
1 1 P full
2 2 F full
3 3 F full
4 4 P part
5 5 F part
6 6 P full
7 7 P full
8 8 F part
9 9 P part
10 10 P full
Возможно с ggplot2
data %>%
pivot_longer(-id) %>%
group_by(name, value) %>%
summarise(n=n()) %>%
ggplot(aes(fill=value, y=n, x=name)) +
geom_bar(position="fill", stat="identity") # Needs polishing