Skip to content

Commit de1f255

Browse files
20250718 - additions
1 parent 4dee56b commit de1f255

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dataManagement.Rmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ is.na(mydata$prediction) | mydata$parch >= 1
276276

277277
# If...Else Conditions {#ifelse}
278278

279+
We can use the construction, `if()...else if()...else()` if we want to perform conditional operations.
280+
The construction, `if()...else if()...else()` can only be used on one value at a time.
281+
279282
```{r}
280283
score <- 15
281284
@@ -293,6 +296,8 @@ if(score <= 10){ # check this condition first
293296
}
294297
```
295298

299+
To apply conditional operations to a vector, we can use the `ifelse()` function.
300+
296301
```{r}
297302
score <- c(1, 10, 20, 40, 100)
298303

0 commit comments

Comments
 (0)