Skip to content

Commit

Permalink
fixing factor_example typos
Browse files Browse the repository at this point in the history
  • Loading branch information
carriewright11 committed Jun 25, 2021
1 parent bdaa129 commit f8e9109
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions factor_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data_highschool %>%
geom_boxplot()
```

OK this is very useful, but it is a bit difficult to read, because we expect the values to be plotted by the order that we know, not by alphabetical order. Currently `grade` is class `character` but lets change that to class `factor` which allows us to specify the levels or order of the values.
OK this is very useful, but it is a bit difficult to read, because we expect the values to be plotted by the order that we know, not by alphabetical order. Currently `grade` is class `character` but let's change that to class `factor` which allows us to specify the levels or order of the values.

```{R}
class(data_highschool$grade)
Expand All @@ -46,7 +46,7 @@ data_highschool_fct %>%
```


Now that's more like it! Notice how the data is automatically plotted in the order we would like it.
Now that's more like it! Notice how the data is automatically plotted in the order we would like.

What about if we arrange the two versions of our data by grade?
```{r}
Expand All @@ -55,7 +55,7 @@ data_highschool_fct %>% arrange(grade)
```


Again notice that the order is not what we would hope for the first version, but it is for the second version!
Again notice that the order is not what we would hope for with the first version, but it is for the second version!

Now what about results from some calculations.

Expand Down
6 changes: 3 additions & 3 deletions factor_example.html

Large diffs are not rendered by default.

0 comments on commit f8e9109

Please sign in to comment.