X-Git-Url: https://code.communitydata.science/stats_class_2020.git/blobdiff_plain/68275101f1d127a83e2c6fd076c9929c6d3f4dd4..c0a584cb21431f64a48de4cf3043e8e07b63ec7d:/r_tutorials/w05a-R_tutorial.rmd diff --git a/r_tutorials/w05a-R_tutorial.rmd b/r_tutorials/w05a-R_tutorial.rmd index f079d7e..c1ef50a 100644 --- a/r_tutorials/w05a-R_tutorial.rmd +++ b/r_tutorials/w05a-R_tutorial.rmd @@ -38,7 +38,7 @@ d <- read_csv(data_url) d ``` -For the sake of my examples, I'm planning to work with the `date`, `state`, `cases`, and `deaths` variables. Notice that by using the `read_csv()` function to import the data, R already recognizes the `date` column as dates. Also notice that the column names for cases and deaths don't reflect the fact that both variables are *cumulative* counts. Also also, notice that it looks like I need to convert the state variable to a factor. I'll start there and then get a quick sense of how much data I have for each state with a univariate table. +For the sake of my examples, I'm planning to work with the `date`, `state`, `cases`, and `deaths` variables. Notice that by using the `read_csv()` function to import the data, R already recognizes the `date` column as dates. Also notice that the column names for cases and deaths don't reflect the fact that both variables are *cumulative* counts. Also also, notice that it looks like I will want to convert the state variable to a factor (since that's a more accurate representation of the data and it will likely make my analysis/plotting work easier later on). I'll start there and then get a quick sense of how much data I have for each state with a univariate table. ```{r} d$state <- factor(d$state) table(d$state)