R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
myDF <- read.csv("sem1-2023.csv")
df <- data.frame(myDF)
clr = c("red","blue")
label=c("all","Male","Female")
title = "English marks"

G7 <- filter(df,Grade == "G7A" | Grade == "G7B")
G7M <- filter(G7,Gender == "M")
G7F <- filter(G7,Gender == "F")
summary(G7$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   14.62   28.00   27.00   38.88   49.00
summary(G7M$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   11.50   21.50   23.54   36.00   49.00
summary(G7F$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0    26.0    33.0    31.8    40.0    49.0
ggplot(G7, aes(x=ENG , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G7 English")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G7$ENG,G7M$ENG,G7F$ENG,names = label,main = title)

ggplot(G7, aes(x=Total , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G7 Total")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

G8 <- filter(df,Grade == "G8A")
G8M <- filter(G8,Gender == "M")
G8F <- filter(G8,Gender == "F")
summary(G8$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   19.25   32.25   28.17   37.75   48.00
summary(G8M$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   17.00   27.50   25.21   36.75   46.00
summary(G8F$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   25.00   33.50   31.52   38.50   48.00
ggplot(G8, aes(x=ENG , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G8 English")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G8$ENG,G8M$ENG,G8F$ENG,names = label,main = title)

ggplot(G8, aes(x=Total , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G8 Total")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

G9 <- filter(df,Grade == "G9A" | Grade == "G9B")
G9M <- filter(G9,Gender == "M")
G9F <- filter(G9,Gender == "F")
summary(G9$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0    19.0    26.0    26.4    36.0    48.5
summary(G9M$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   15.50   25.50   23.83   34.00   47.50
summary(G9F$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   21.00   26.00   28.52   36.00   48.50
ggplot(G9, aes(x=ENG , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G9 English")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G9$ENG,G9M$ENG,G9F$ENG,names = label,main = title)

ggplot(G9, aes(x=Total , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G9 Total")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

G10 <- filter(df,Grade == "G10A")
G10M <- filter(G10,Gender == "M")
G10F <- filter(G10,Gender == "F")
summary(G10$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   23.00   39.75   54.75   57.75   80.75   94.00
summary(G10M$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   23.00   43.50   52.75   56.97   81.25   88.00
summary(G10F$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   28.00   36.75   60.50   58.64   78.50   94.00
ggplot(G10, aes(x=ENG , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G19 English")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G10$ENG,G10M$ENG,G10F$ENG,names = label,main = title)

ggplot(G10, aes(x=Total , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G10 Total")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

G11 <- filter(df,Grade == "G11A")
G11M <- filter(G11,Gender == "M")
G11F <- filter(G11,Gender == "F")
summary(G11$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   20.12   29.50   28.16   39.00   46.00
summary(G11M$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00   19.75   27.00   26.64   36.00   45.00
summary(G11F$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    7.50   23.00   31.00   29.15   39.00   46.00
ggplot(G11, aes(x=ENG , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G11 English")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G11$ENG,G11M$ENG,G11F$ENG,names = label,main = title)

ggplot(G11, aes(x=Total , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G11 Total")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

G12 <- filter(df,Grade == "G12A")
G12M <- filter(G12,Gender == "M")
G12F <- filter(G12,Gender == "F")
summary(G12$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    9.50   22.00   34.00   32.88   44.00   49.50
summary(G12M$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    9.50   19.75   28.00   29.36   41.50   49.50
summary(G12F$ENG)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   20.00   33.25   36.25   37.80   45.50   49.00
ggplot(G12, aes(x=ENG , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G12 English")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G12$ENG,G12M$ENG,G12F$ENG,names = label,main = title)

summary(G12$MAT)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    5.00   24.25   36.50   46.71   64.25  115.00
summary(G12M$MAT)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    5.00   14.50   34.50   39.71   46.50  110.00
summary(G12F$MAT)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    6.00   31.50   47.50   56.50   83.75  115.00
ggplot(G12, aes(x=MAT , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G12 Maths")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G12$MAT,G12M$MAT,G12F$MAT,names = label,main = "Maths")

ggplot(G12, aes(x=Total , fill = factor(Gender))) + geom_dotplot(position = "dodge", dotsize = 1 )+ggtitle("G12 Total")
## Bin width defaults to 1/30 of the range of the data. Pick better value with
## `binwidth`.
## Warning: `position_dodge()` requires non-overlapping x intervals

boxplot(G12$Total,G12M$Total,G12F$Total,names = label,main = "Total")

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.