Setting up R Project Link to download R: https://www.rstudio.com/products/rstudio/download/ Link to download R console: https://www.r-project.org/ Useful links for R: https://www.rdocumentation.org/ https://cran.r-project.org/manuals.html
csv. file Example of csv. file link: http://professormo.com/statClub.html
Setting up the directory of opening the file
setwd(dir) setwd (Set Working Directory) returns the current directory before the change, invisibly and with the same conventions as getwd. It will give an error if it does not exist. Variables can then be accessed by their name only.
How to find the directory of file
Accessing the csv. file
Attach the file
Access the first row of the values in csv. file
names(file object name) Returns the first row of values
Showing the overall point above 2 colleges
boxplot(varA~varB) Produce box-and-whisker plot(s) of the given (grouped) values. varA : The variable that represent the number ~ : the connection to varA and varB varB : The object that compares
Showing the elements in “Division” column
levels(var) levels provides access to the levels attribute of a variable. The first form returns the value of the levels of its argument and the second sets the attribute.
T-test of overall and college
t.test(varA~varB) Performs one and two sample t-tests on vectors of data. varA: The value that is using for calculation varB: The binary variable that defines the populations being compared
Left-tailed t-test
Showing the table of gender in Division
myTable <-table(varA, varB): table: table uses the cross-classifying factors to build a contingency table of the counts at each combination of factor levels. <- : assignment operator myTable: the variable that contains all the collection of
Showing the histograms of easiness
hist(dataName) hist: The generic function hist computes a histogram of the given data values. dataName: the value that is calculated for the histogram.