# ExamSco2 Example -- examsco3.R source code. # Load ExamSco dataset into R. examsco <- read.fwf("examsco3.txt", header=FALSE, skip=2, widths=c(4, 9, 1, 1, 2, 2), strip.white=TRUE, col.names=c("Id", "Name", "Gender", "Year", "midterm", "final")) # Print dataset stored as a list. print("examsco table:") print(examsco) # Compute and print exam average. examave = (examsco$midterm + examsco$final) / 2 print(examave) # Print descriptive statistics for examave. print("mean:") print(mean(examave)) print("sd:") print(sd(examave)) print("min:") print(min(examave)) print("max:") print(max(examave))