Clarify what +ve and -ve are, closes #1496
This commit is contained in:
parent
d9555d4276
commit
a8a6d1bfbd
|
@ -426,7 +426,7 @@ You'll always use the first three argument of `if_else()`. The first argument, `
|
||||||
[^logicals-4]: dplyr's `if_else()` is very similar to base R's `ifelse()`.
|
[^logicals-4]: dplyr's `if_else()` is very similar to base R's `ifelse()`.
|
||||||
There are two main advantages of `if_else()`over `ifelse()`: you can choose what should happen to missing values, and `if_else()` is much more likely to give you a meaningful error if your variables have incompatible types.
|
There are two main advantages of `if_else()`over `ifelse()`: you can choose what should happen to missing values, and `if_else()` is much more likely to give you a meaningful error if your variables have incompatible types.
|
||||||
|
|
||||||
Let's begin with a simple example of labeling a numeric vector as either "+ve" or "-ve":
|
Let's begin with a simple example of labeling a numeric vector as either "+ve" (positive) or "-ve" (negative):
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
x <- c(-3:3, NA)
|
x <- c(-3:3, NA)
|
||||||
|
|
Loading…
Reference in New Issue