From b4635bff64030babaa9c9ea430664b744ef19f7e Mon Sep 17 00:00:00 2001 From: avahoffman Date: Tue, 16 Jul 2024 14:03:46 -0400 Subject: [PATCH] Remove JHUR ref --- modules/Factors/lab/Factors_Lab.Rmd | 13 ++++++------ modules/Factors/lab/Factors_Lab.html | 19 ++++++++++++----- modules/Factors/lab/Factors_Lab_Key.Rmd | 16 ++++++-------- modules/Factors/lab/Factors_Lab_Key.html | 27 ++++++++++++++---------- 4 files changed, 44 insertions(+), 31 deletions(-) diff --git a/modules/Factors/lab/Factors_Lab.Rmd b/modules/Factors/lab/Factors_Lab.Rmd index 395c0545..5d301e82 100644 --- a/modules/Factors/lab/Factors_Lab.Rmd +++ b/modules/Factors/lab/Factors_Lab.Rmd @@ -5,19 +5,20 @@ editor_options: chunk_output_type: console --- -Load all the libraries we will use in this lab. +Load all the packages we will use in this lab. ```{r message=FALSE} -library(dplyr) -library(ggplot2) +library(tidyverse) ``` ### 1.0 -Load the Youth Tobacco Survey data (using the `jhur` library function `read_yts()`). `select` "Sample_Size", "Education", and "LocationAbbr". Name this data "yts". - -```{r 1.0response} +Load the Youth Tobacco Survey data and `select` "Sample_Size", "Education", and "LocationAbbr". Name this data "yts". +```{r} +yts <- + read_csv("https://daseh.org/data/Youth_Tobacco_Survey_YTS_Data.csv") %>% + select(Sample_Size, Education, LocationAbbr) ``` ### 1.1 diff --git a/modules/Factors/lab/Factors_Lab.html b/modules/Factors/lab/Factors_Lab.html index ee3f6e0a..aa5aedc5 100644 --- a/modules/Factors/lab/Factors_Lab.html +++ b/modules/Factors/lab/Factors_Lab.html @@ -353,15 +353,24 @@

Factors Lab

-

Load all the libraries we will use in this lab.

-
library(dplyr)
-library(ggplot2)
+

Load all the packages we will use in this lab.

+
library(tidyverse)

1.0

-

Load the Youth Tobacco Survey data (using the jhur -library function read_yts()). select +

Load the Youth Tobacco Survey data and select “Sample_Size”, “Education”, and “LocationAbbr”. Name this data “yts”.

+
yts <- 
+  read_csv("https://daseh.org/data/Youth_Tobacco_Survey_YTS_Data.csv") %>% 
+  select(Sample_Size, Education, LocationAbbr)
+
## Rows: 9794 Columns: 31
+## ── Column specification ────────────────────────────────────────────────────────
+## Delimiter: ","
+## chr (24): LocationAbbr, LocationDesc, TopicType, TopicDesc, MeasureDesc, Dat...
+## dbl  (7): YEAR, Data_Value, Data_Value_Std_Err, Low_Confidence_Limit, High_C...
+## 
+## ℹ 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.

1.1

diff --git a/modules/Factors/lab/Factors_Lab_Key.Rmd b/modules/Factors/lab/Factors_Lab_Key.Rmd index 61f4321e..1dd97b8c 100644 --- a/modules/Factors/lab/Factors_Lab_Key.Rmd +++ b/modules/Factors/lab/Factors_Lab_Key.Rmd @@ -5,22 +5,20 @@ editor_options: chunk_output_type: console --- -Load all the libraries we will use in this lab. +Load all the packages we will use in this lab. ```{r message=FALSE} -library(dplyr) -library(ggplot2) +library(tidyverse) ``` ### 1.0 -Load the Youth Tobacco Survey data (using the `jhur` library function `read_yts()`). `select` "Sample_Size", "Education", and "LocationAbbr". Name this data "yts". +Load the Youth Tobacco Survey data and `select` "Sample_Size", "Education", and "LocationAbbr". Name this data "yts". -```{r 1.0response} -library(jhur) -yts <- read_yts() %>% select(Sample_Size, Education, LocationAbbr) -# Alt: -# yts <- read_csv("https://daseh.org/data/Youth_Tobacco_Survey_YTS_Data.csv") +```{r} +yts <- + read_csv("https://daseh.org/data/Youth_Tobacco_Survey_YTS_Data.csv") %>% + select(Sample_Size, Education, LocationAbbr) ``` ### 1.1 diff --git a/modules/Factors/lab/Factors_Lab_Key.html b/modules/Factors/lab/Factors_Lab_Key.html index 8f3d3fea..3193eca4 100644 --- a/modules/Factors/lab/Factors_Lab_Key.html +++ b/modules/Factors/lab/Factors_Lab_Key.html @@ -353,19 +353,24 @@

Factors Lab - Key

-

Load all the libraries we will use in this lab.

-
library(dplyr)
-library(ggplot2)
+

Load all the packages we will use in this lab.

+
library(tidyverse)

1.0

-

Load the Youth Tobacco Survey data (using the jhur -library function read_yts()). select +

Load the Youth Tobacco Survey data and select “Sample_Size”, “Education”, and “LocationAbbr”. Name this data “yts”.

-
library(jhur)
-yts <- read_yts() %>% select(Sample_Size, Education, LocationAbbr)
-# Alt:
-# yts <- read_csv("https://daseh.org/data/Youth_Tobacco_Survey_YTS_Data.csv")
+
yts <- 
+  read_csv("https://daseh.org/data/Youth_Tobacco_Survey_YTS_Data.csv") %>% 
+  select(Sample_Size, Education, LocationAbbr)
+
## Rows: 9794 Columns: 31
+## ── Column specification ────────────────────────────────────────────────────────
+## Delimiter: ","
+## chr (24): LocationAbbr, LocationDesc, TopicType, TopicDesc, MeasureDesc, Dat...
+## dbl  (7): YEAR, Data_Value, Data_Value_Std_Err, Low_Confidence_Limit, High_C...
+## 
+## ℹ 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.

1.1

@@ -378,7 +383,7 @@

1.1

geom_boxplot()
## Warning: Removed 425 rows containing non-finite outside the scale range
 ## (`stat_boxplot()`).
-

+

1.2

@@ -413,7 +418,7 @@

1.4

geom_boxplot()
## Warning: Removed 425 rows containing non-finite outside the scale range
 ## (`stat_boxplot()`).
-

+

yts_fct %>%
   count(Education)
## # A tibble: 2 × 2