alperyilmaz / dav-exercises

Exercise questions submitted by Data Analysis and Visualization with R course students at YTU
GNU General Public License v3.0
1 stars 2 forks source link

Data Visualization #9

Open gizemdgn opened 6 years ago

gizemdgn commented 6 years ago

Please fill in the form to submit an exercise question. Please state the question under Question section. Please try to be as specific as possible when describing the problem. In hint chunk, you can provide a statement (which function to use, or which columns to join, etc.) or you can provide first 1-2 lines of expected result. Please refer to Github markdown table instructions if you need to include a table. In solution chunk please provide the code to solve the problem. Your solutions should be runnable in anybody's computer. Thus, please don't include file locations in your own computer while importing data. The data should be coming from a R package or from an online source.

Question

Gr2-Grades.xlsx

As we remember, there was the midterm exam in 14th November. Unfortunately some students, including me :( , get score under the average of the group 2 class. To see the results, write a code in ggplot and determine how many students get score under the average for midterm. Also the first quiz scores should be indicated on the same plot. (The file is loaded as an excel file above the question, please download it at first). Output must be like these;

image

image

library(ggplot2)
library(dplyr)
library(readxl)
Gr2_Grades <- read_excel("Gr2-Grades.xlsx")
MeanGrades <- mean(Gr2_Grades$Midterm1)
Gr2_Grades %>%
  group_by(StudentNo) %>%
  summarise(ave_Midterm1 = mean(Midterm1,na.rm = TRUE),
         ave_Quiz1 = mean(Quiz1,na.rm = TRUE)) %>%
  ggplot() +
  geom_point(aes(x=StudentNo ,y=ave_Midterm1 , col="Midterm1")) +   
  geom_point(aes(x=StudentNo ,y=ave_Quiz1 , col="Quiz1")) +
  geom_hline(yintercept = MeanGrades, colour = "white", size = 3) +
  coord_flip()
Gr2_Grades %>%
  filter(Midterm1<MeanGrades) %>%
  count()

image

About images: If your question or solution contains an image, please attach necessary images by dragging them here or copy/pasting from clipboard. After the upload, a markdown style link to image will be generated for you.

Additional information

Originality

Please mark relevant information with x, (ex. [x])

Is this question

If you select Inspired or Paraphrased please provide the links in markdown format ( [link](http://example.com) ). Please provide all relevant links. You can refer to DataCamp course pages if you're inspired by them.

Difficulty Level

According to you, what is the level of difficulty of the question (note: this can be modified by instructor after submission)

Tags (optional)

Please provide comma separated list of dplyr verbs (e.g. summarize, left join) or concepts (e.g. text mining) that you think are relevant with question

Before submitting

alperyilmaz commented 6 years ago

I think we talked about this during class, read_excel("C:/Users/perfe/Desktop/x/Gr2-Grades.xlsx") is a big NO NO!

The data for the question should be accessible by others.

gizemdgn commented 6 years ago

The excel file is loaded on the question, I just edited it. Sorry for the mistake.

alperyilmaz commented 6 years ago

some issues:

gizemdgn commented 6 years ago

I updated the question. Thank you for your helping.