Skip to content

Commit 015df4a

Browse files
removing OCSdata
1 parent f84c46f commit 015df4a

File tree

1 file changed

+6
-33
lines changed

1 file changed

+6
-33
lines changed

modules/Subsetting_Data_in_R/Subsetting_Data_in_R.Rmd

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -91,50 +91,27 @@ We will use a dataset from a project we worked on called Open Case Studies.
9191

9292
See https://www.opencasestudies.org/.
9393

94-
First we need to install and load the package.
94+
We have added the specific data to our website.
9595

96-
```{r, eval = FALSE}
97-
install.packages("OCSdata")
98-
```
99-
100-
```{r, echo = FALSE, message=FALSE, comment= FALSE, results='hide'}
101-
install.packages("OCSdata", repos='http://cran.us.r-project.org')
102-
```
103-
104-
```{r}
105-
library(OCSdata)
106-
```
10796

10897
## Getting data to work with
10998

110-
Then we will load data from one of the case studies about opioid shipments.
111-
112-
See https://cran.r-project.org/web/packages/OCSdata/vignettes/instructions.html for more info on what data is available.
99+
We will load data from one of the case studies about opioid shipments.
113100

114101
See https://www.opencasestudies.org/ocs-bp-opioid-rural-urban/ about this data.
115102

116103

117104
## Import the data
118105

119-
Now we will get the data from the `OCSdata` package using the `load_imported_data()` function.
120-
121-
```{r}
122-
load_imported_data("ocs-bp-opioid-rural-urban")
123-
```
106+
We will work with data called `annualDosage` (number of shipments (count) of either oxycodone or hydrocodone pills (DOSAGE_UNIT)).
124107

125-
You will see a few new objects in your environment called:
126-
127-
- `annualDosage` (number of shipments (count) of either oxycodone or hydrocodone pills (DOSAGE_UNIT)) - *we will work with this one for now*
128-
- `county_pop` (population per county)
129-
- `land` (land area per county)
130-
131-
## Import the data - method 2
132108

133109
```{r}
134110
annualDosage <- read_csv("https://jhudatascience.org/intro_to_r/data/annualDosage.csv")
135111
136112
```
137113

114+
138115
## Checking the data `dim()`
139116

140117
The `dim()`, `nrow()`, and `ncol()` functions are good options to check the dimensions of your data before moving forward.
@@ -419,9 +396,7 @@ clean_names(test)
419396
This time lets also make it a smaller subset so it is easier for us to see the full dataset as we work through examples.
420397

421398
```{r}
422-
#install.packages(OCSdata)
423-
#library(OCSdata)
424-
#OCSdata::load_imported_data("ocs-bp-opioid-rural-urban")
399+
#read_csv("https://jhudatascience.org/intro_to_r/data/annualDosage.csv")
425400
set.seed(1234)
426401
AD <-slice_sample(annualDosage, n = 30)
427402
```
@@ -681,9 +656,7 @@ https://media.giphy.com/media/5b5OU7aUekfdSAER5I/giphy.gif
681656
## Get the data
682657

683658
```{r}
684-
#install.packages(OCSdata)
685-
#library(OCSdata)
686-
#OCSdata::load_imported_data("ocs-bp-opioid-rural-urban")
659+
#read_csv("https://jhudatascience.org/intro_to_r/data/annualDosage.csv")
687660
set.seed(1234)
688661
AD <-slice_sample(annualDosage, n = 30)
689662
```

0 commit comments

Comments
 (0)