library(ggplot2)
library(webr)
library(dplyr)
data <- as.data.frame(Titanic)
head(data)
# Building a table with the data for the plot
PD = data %>% group_by(Class, Survived) %>% summarise(n = sum(Freq))
print(PD)
# Pie-Donut chart
PieDonut(PD, aes(Survived, Class, count=n),
title = "Titanic: Survival by Class")
Generated warning message:
The
<scale>argument ofguides()cannot beFALSE. Use "none"instead as of ggplot2 3.3.4.
ℹ The deprecated feature was likely used in the webr package.