X-Git-Url: https://code.communitydata.science/stats_class_2020.git/blobdiff_plain/0a581181eaac0541c14bab5a28584879d1ff9f63..e3ddf944e95a350a79e1604bf73e4e90005ad9ff:/r_tutorials/w05a-R_tutorial.rmd?ds=inline 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)