This assignment you will be practicing working with dataframes in R. Reading in data calculating simple statistics.
We will be working with the education_data.csv file we
saw in class. This file are records of students test scores in the fall
and spring semesters in one academic school year.
Create a R script to record all the answers to these questions.
Set up a R project to do this assignment in. Download the
education_data.csv on google drive and put it into project
folder
education_data.csv located on your computer
abs function does and use it in an
example?#code template
?function_name
na.rm argument of the
mean function and what does the na.rm argument
control?#code template
?function_name
#Code template
my_dataframe <- read.csv("path to the file")
#Code template
names(my_dataframe)
#Code template
nrow(my_dataframe)
numbers_of_rows <- nrow(my_dataframe)
#Code template
unique(my_dataframe$column_name)
#Code template
table(my_dataframe$column_name)
#R knowledge
#TRUE can be treated the value 1 so we can take the sum to get all
#the number of TRUE values
logic_test <- c(TRUE, FALSE, TRUE, FALSE) # 2 TRUE values
sum(logic_test)
#Code template
logic_missing <- is.na(my_dataframe$column_name)
total_missing <- sum(logic_missing)
total_missing/numbers_of_rows
#Code template
logic_greaterthan <- my_dataframe$column_name > my_dataframe$column_name
sum(logic_greaterthan)/numbers_of_rows
#Code template
my_dataframe$new_column <- my_dataframe$column_name + my_dataframe$column_name
#Code template
mean(my_dataframe$new_column)
#Code template
my_dataframe$new_column <- my_dataframe$column_name - my_dataframe$column_name
write.csv(my_dataframe, file = "newfilename.csv")
new_education_data <- read.csv("newfilename.csv")
names(new_education_data)