Question: I don't know why this box plot is incorrect? ## Get data for mtcars df
I don't know why this box plot is incorrect?
## Get data for mtcars df <- mtcars
## I need to use only the qsec data in mtcars qsec <- mtcars$qsec
## Calculate mode: ## Installed "modeest"
library(modeest) Mode_qsec <- mlv(qsec, method = "mfv") Mode_qsec
## Calculate Range:
Range_qsec <- max(qsec, na.rm = TRUE) - min(qsec, na.rm = TRUE)
Range_qsec
##Calculate mean, median, Q1 and Q3
Mean_qsec <- mean(qsec) Mean_qsec
Median_qsec <- median(qsec) Median_qsec
Q1_qsec <- quantile(qsec, .25) Q1_qsec
Q3_qsec <- quantile(qsec, .75) Q3_qsec
Min_qsec <- min(qsec, na.rm = FALSE) Min_qsec
Max_qsec <- max(qsec, na.rm = FALSE) Max_qsec ## Organize Statistical Calculation in a table
table_qsec <- data_frame(expand.grid( Mean = Mean_qsec, Median = Median_qsec, Mode = Mode_qsec, Q1 = Q1_qsec, Q3 = Q3_qsec, Range = Range_qsec, Minimum = Min_qsec, Maximun = Max_qsec ))
table_qsec
#### Make a Boxplot of qsec measures of location
BP <- ggplot(qsec, aes(x = qsec)) + geom_boxplot(range = 0) + stat_summary(fun = median, geom = "point", shape = 23, color = "deeppink", size = 3, fill = "black") + labs(title = "Qsec Measures of Location", x = "qsec") + theme_linedraw() + theme(plot.title = element_text(hjust = .5)) + stat_boxplot(geom = "errorbar", size = 1) + horizontal = TRUE
Error in BP <- ggplot(qsec, aes(x = qsec)) + geom_boxplot(range = 0) + : could not find function "<-<-"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
