Homework should be written as an R Markdown file and the knitted output should be submitted. Homework should be turned in on Sakai.
library(tidyverse)
Take a screenshot of your RStudio. You will get full credit if in the screenshot I see the class folders (under the files tab) and I see the git tab on the upper right window. For further instructions on how to include pictures, see the R Markdown cheat sheet.
mean_value. Print the mean_valuevector <- c(5 , 10 , 15 , 20)
mean_value <- mean(vector)
Make sure to include at least three rows of data. Print the entire data frame. Name it whatever you like.
Name <- c("Anoushka", "Rahee", "Leah")
Age <-c(18, 18, 19)
FavoriteColor <- c("green", "pink", "blue")
Friends <- data.frame(Name, Age, FavoriteColor)
vector1 with values
1, 2, 3, and vector2 with values 4, 5, 6. Perform the
following operations:vector1 and vector2 and store the
result in a new vector called sum_vector.vector2 from vector1 and store
the result in a new vector called diff_vector.vector1 and vector2 element-wise
and store the result in a new vector called
prod_vector.vector1 by vector2 element-wise and
store the result in a new vector called quot_vector.Print all four result vectors.
vector1 <- c(1,2,3)
vector2 <- c(4,5,6)
sum_vector <-c(vector1+vector2)
diff_vector <-c(vector1-vector2)
prod_vector <-c(vector1*vector2)
quot_vector <-c(vector1/vector2)
top_colleges_2022 dataset answer the
following questions.college.
This should be simple if question 1 has been completed as the github
will download the data folder.college <- readr::read_csv("C:/Users/emili/OneDrive/Desktop/DSCI_101/data/top_colleges_2022.csv")
## New names:
## Rows: 498 Columns: 25
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (13): description, organizationName, state...4, campusSetting, website, ... dbl
## (12): rank, studentPopulation, medianBaseSalary, longitude, latitude, ye...
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `state` -> `state...4`
## • `state` -> `state...14`
There are 16 colleges in Illinois in this data set.
Illinois_colleges <-stats::filter(college, "stateCode" == "IL")
The undergraduate population of Loyola is 13878 according to the data set.
undergrad_pop <- filter(college, "undergradPop" > 13878)