Student <- read.table(“Assignment 6 Dataset-1.txt”, header = TRUE, sep = “,”)
sex <- Student$Sex
StudentAverage = ddply(Student,”Sex”,transform,Grade.Average=mean(Grade))
write.table(StudentAverage, “sortedAverage”)
new <- subset(Student, grepl(“i”, Student$Name, ignore.case=T))
OUTPUT
Reading the files was an easy task because I have done this before. But some of the functions that were new to me were file.choose() and read line(). Stringsplit was new to me because I have not used this function in R but I have used in other languages.
I find the function subset to be very helpful when sorting the data in order to understand it better.