Module 8 Assignment

 Module 8 Assignment



Step 1
    I successfully imported the data from the "Assignment 6 Dataset" text tile using the read.table function and separating by commas. I then used the plyr package "ddply" where "dd" means it takes in a data frame and returns a data frame. The transform function call creates a new column that calculates the average grade as shown below. 
    I then found the mean of the sex column. This returns "NA" because the values are male/female, not numerical. I wrote the average grade data frame to a csv file using the write.table function. This returned the following:


Step 2
    I created a new data frame StudentNames which took a subset of the original data frame. Grepl[iI] finds any instances where the name contains "i" or "I". This was also written to a csv file as shown below:

Weekly readings
  • A quick introduction to plyr by Sean Anderson (2012).
  • The Art of R programming, Norman Matloff chapters 10 -11 pp. 231-260

Comments

Popular posts from this blog

Module 10 Assignment

Module 1 Assignment