knitr::opts_chunk$set(echo = FALSE)
Data Science in Education Using R Ryan A. Estrellado, Emily A. Bovee, Jesse Mostipak, Joshua M. Rosenberg, and Isabella C. Velásquez https://datascienceineducation.com/
Bookclub GitHub Repo https://github.com/r4ds/bookclub-dsieur
print("We're going to use R as a calculator.")
print("First up, addition!")
12 + 8
632 + 41
print("Next, subtraction!")
48 - 6
0.65 - 1.42
print("We're going to use R as a calculator.") print("First up, addition!") 12 + 8 632 + 41 print("Next, subtraction!") 48 - 6 0.65 - 1.42
'# we've named the function "addition" and asked for two arguments, "number_1" and "number_2"
addition <- function(number_1, number_2) {
number_1 + number_2
}
addition(number_1 = 3, number_2 = 1)
addition(0.921, 12.01)
addition(62, 34)
#' writing our function #' we've named the function "addition" #' and asked for two arguments, "number_1" and "number_2" addition <- function(number_1, number_2) { number_1 + number_2 } #' using our function #' below are 3 separate examples of utilizing our new function called "addition" #' note that we provide each argument separated by commas addition(number_1 = 3, number_2 = 1) addition(0.921, 12.01) addition(62, 34)
library(tidyverse)
library(janitor)
roster <- roster_raw %>%
clean_names() %>%
remove_empty(c("rows", "cols")) %>%
mutate(hire_date = excel_numeric_to_date(hire_date),
cert = coalesce(certification, certification_1)) %>%
select(-certification, -certification_1)
`# using the filter() function from the stats package
x <- 1:100
stats::filter(x, rep(1, 3))
`# using the filter() function from the dplyr package
starwars %>%
dplyr::filter(mass > 85)
dataedu::ma_data_init
dataedu::ma_data_init -> ma_data
ma_data_init <- dataedu::ma_data_init
names(ma_data_init)
glimpse(ma_data_init)
summary(ma_data_init)
glimpse(ma_data_init$Town)
summary(ma_data_init$Town)
glimpse(ma_data_init$AP_Test Takers
)
summary(ma_data_init$AP_Test Takers
)
ma_data_init %>%
group_by(District Name
) %>%
count()
ma_data_init %>%
group_by(District Name
) %>%
count() %>%
filter(n > 10)
ma_data_init %>%
group_by(District Name
) %>%
count() %>%
filter(n > 10) %>%
arrange(desc(n))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.