SQL Project -- 3
Budget: $10 – $20 USD
Use this data in R Studio:
library(MASS)
head(bacteria)
?bacteria
Find a dataset in R to use for all of the prompts in this problem set. You can use the same dataset as you used in the group activity, but remember that everyone must turn in their own code. The instructions are as follows:
Filter your dataset.
Exclude rows based on the value of one variable.
Exclude rows based on the value of two variables using | or &.
Choose columns.
Remove at least one column from your dataset.
Rename two variables.
Create two new variables in your dataset. At least one should include if_else().
Create an aggregated dataset using group_by() and summarize(). Save the dataset to a new variable.
Create three visualizations using your dataset. You can use the two visualizations you sketched for the group activity, but be sure to meet the criteria below.
Use at least three geoms.
At least one visualization should use color or shape as an encoding.
At least one visualization should be based on an aggregated version of your dataset. You can use the aggregated dataset you created in #4 above.
All visualizations should have a meaningful title and axis labels.
IMPORTANT NOTE:
if you are using a dataset from the package MASS: There is a function called select in both MASS and tidyverse. In order to make sure that select() works as you intend (to select columns from a tibble), load the MASS library BEFORE you load the tidyverse libraries. Here is an example:
library(MASS)
library(tidyverse)
If you continue to have issues, use dplyr::select() instead of just typing select().
library(MASS)
head(bacteria)
?bacteria
Find a dataset in R to use for all of the prompts in this problem set. You can use the same dataset as you used in the group activity, but remember that everyone must turn in their own code. The instructions are as follows:
Filter your dataset.
Exclude rows based on the value of one variable.
Exclude rows based on the value of two variables using | or &.
Choose columns.
Remove at least one column from your dataset.
Rename two variables.
Create two new variables in your dataset. At least one should include if_else().
Create an aggregated dataset using group_by() and summarize(). Save the dataset to a new variable.
Create three visualizations using your dataset. You can use the two visualizations you sketched for the group activity, but be sure to meet the criteria below.
Use at least three geoms.
At least one visualization should use color or shape as an encoding.
At least one visualization should be based on an aggregated version of your dataset. You can use the aggregated dataset you created in #4 above.
All visualizations should have a meaningful title and axis labels.
IMPORTANT NOTE:
if you are using a dataset from the package MASS: There is a function called select in both MASS and tidyverse. In order to make sure that select() works as you intend (to select columns from a tibble), load the MASS library BEFORE you load the tidyverse libraries. Here is an example:
library(MASS)
library(tidyverse)
If you continue to have issues, use dplyr::select() instead of just typing select().