I got below project for an ongoing course and facing some difficulties to solve it.
Simply I'm trying to create different types of graphs based on a give excel sheet. When I run the code I
the error shown in the photo. Any help on how it can be resolved?
Below is the code I developed
# Changing format
Data1$Date <- as.Date(Data1$Date)
Data1$Department <- as.factor(Data1$Department)
Data1$Category <- as.factor(Data1$Category)
Data1$CustomerCode <- as.character(Data1$CustomerCode)
Data1$Price <- as.factor(Data1$Price)
Data1$Quantity <- as.factor(Data1$Quantity)
# Summary statistics of a column in R
summary(Data1$Quantity)
summary(Data1$Price)
#count of NA values in each column
sum(is.na(df$Date))
sum(is.na(df$Department))
sum(is.na(df$Category))
sum(is.na(df$CustomerCode))
sum(is.na(df$Price))
sum(is.na(df$Quantity))
#Display a bar chart for Category column.
ggplot(Data1, aes(x = Category))
geom_bar()
#Display the Departments and their revenue using a bar chart
barplot(Data1$Department)
#Create a histogram and box and whisker plot of the Price and Quantity columns
hist(Data1$Price, prob = TRUE, col = "white",main = "")
boxplot(Data1$Price, horizontal = TRUE, axes = FALSE, col = rgb(0, 0.8, 1, alpha = 0.5))
hist(Data1$Quantity, prob = TRUE, col = "white",main = "")
boxplot(Data1$Quantity, horizontal = TRUE, axes = FALSE, col = rgb(0, 0.8, 1, alpha = 0.5))