You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Final stop along this specific beautification journey, for now at least! But before we move onto histograms, a note about another useful `tidyverse` feature - being able to quickly create a new variable based on conditions from more than one of the existing variables.
524
-
525
-
<divclass="bs-callout-blue"markdown="1">
526
-
527
-
__A data manipulation tip:__ Using `case_when()`, combined with `mutate`, is a great way to create new variables based on one or more conditions from other variables.
528
-
</div>
529
-
530
-
```r
531
-
# Create new columns based on a combo of conditions using case_when()
__A data manipulation tip:__ Often we have missing values, or not everything has a category, for example in the magic plot above, many of the species are classified as `NA`. If we want to drop those records, we can use `drop_na()` and in the brackets specify which specific column(s) should be the evaluator.
0 commit comments