Assignment 1

WISE R CLUB, Xiaojun Sun, 2014.06.25

This is the first assignment for WISE R Club members. I believe you are able to accomplish this assignment after reading the first four chapters of R in Action. The question is described as following.

Question

There are 300 grade one students in the DongShan junior high school. Recently they held a exam for all the students in grade one. Only 3 subjects (Math, Chinese and English) are included in this exam. The grades data for all the students is stored in grades.txt which I have already distributed to you. Please answer the following questions use R based on this dataset.

  1. Import the grades.txt into R to create a data frame which contains four variables: name, Math, Chinese and English.
  2. Plot a histogram graph for the grade of Math. Modify the default options of the hist function to get a better graph.
  3. Plot a graph combining the scatter-plots for Math vs Chinese and Math vs English in either horizontal or vertical way. Include a title in this graph. If you can (you don’t have to) add a fitted line in each subgraph, the graph will be more meaningful.
  4. Tell me how many students pass the exam(the grades of all three subjects >= 60).
  5. The headmaster decides to reward the outstanding students. A student is regarded as outstanding if the grades of all three subjects >= 90. Who does he should reward ? There could be more than one outstanding student.

How to submit the solutions?

You need to send your solution in PDF format to my email (xiaojunsunshine@126.com) before 4th July 24:00.

Notice

Please note that I only check PDF format solution. If you write your solution in Word, please convert it into PDF.

You also need to note that I will not check any emails after the deadline. I’m sorry for that. But I think the time is enough for you to accomplish this assignment.

This question is fictional. If there are any errors about the question itself, please let me know.

Please forgive me for my poor English.

If you are not sure how to use a function, the best solution is to use the help functions in R which is summarized in Table 1.2. For more complicated questions you can search Rseek, StackOverflow, Google and Baidu for help. Know how to ask for help is the most important skill you should master.

 

Return to the homepage.


WISE R Club project is proudly maintained by XiaojunSun.