Question: Please redo this problem, the code provided does not produce the bar plot required. The dataset provided in the answer is missing the percentages that

Please redo this problem, the code provided does not produce the bar plot required. The dataset provided in the answer is missing the percentages that are needed to produce the bar plot. Using R Markdown in RStudio : Create a bar plot using ggplot that shows ratings categories for the years
2015-2022 in the Customer Satisfaction Survery data attached.\table[[Please rat...
:,2020 : ,2019 : ,2017 : ,2016 : ,2015 :,2021!,2022
Poor, 4.3%,3%,2%,2.4%,3.5%,6.94%,6.82%],[Satisfactory
,29.7%,24.2%,26.4%,29.1%,29.7%,27.95%,31.43%,[Above Average,
30.2%,29.5%,31.5%,33.7%,31.2%,26.78%,23.5%],[Excellent
,35.5%,42.6%,38.6%,34.6%,34.4%,36.52%,36.86% Step 2
The R studio code to perfrom Bar plot is,
install.packages("ggplot2") # Only run this line if ggplot2 is not already installed
library(ggplot2)
ratings_data - data.frame(
Year = rep(c("2015","2016","2017","2019","2020","2021","2022"), each =5),
Rating = rep(c("Very Poor", "Poor", "Satisfactory", "Above Average", "Excellent"), times =7),
print(ratings_data)
ggplot(ratings_data, aes(x = Year, y = Percentage, fill = Rating))
geom _ bar(stat = "identity", position = "dodge")+
labs(title = "Customer Satisfaction Ratings (2015-2022)",
x = "Year",
y = "Percentage (%)")+
theme_minimal()+
scale _ fill _ brewer(palette = "Set3") # Option to apply a color palette Error in geom_blank():
! Problem while computing aesthetics.
i Error occurred in the 1st layer.
Caused by error:
object 'Percentage' not found
Backtrace:
base (local)(x)
ggplot2:::print.ggplot(x)
ggplot2:::ggplot_build.ggplot(x)
ggplot2:::by_layer(...)
ggplot2(local) f(l = layers[[i]], d = data[[i]])
l$compute_aesthetics(d, plot)
ggplot2(local) compute_aesthetics(..., self = self)
Please redo this problem, the code provided does

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!