Skip to content
Snippets Groups Projects
Commit ad6c12e1 authored by Carine Rey's avatar Carine Rey
Browse files

typo + more explicite example

parent 81f2b147
No related branches found
No related tags found
1 merge request!6Switch to main as default branch
...@@ -952,7 +952,7 @@ You can use booleans to define which values should be kept. ...@@ -952,7 +952,7 @@ You can use booleans to define which values should be kept.
```{r index2, include=TRUE} ```{r index2, include=TRUE}
x <- c(1,5,7,8,15) x <- c(1,5,7,8,15)
x[c(TRUE,FALSE,TRUE,FALSE,TRUE)] x[c(TRUE,FALSE,TRUE,FALSE,TRUE)]
x[c(FALSE,TRUE)] # Bolean vector is reuse if it is not of the same size of the vector to index x[c(FALSE,TRUE)] # Bolean vector is reused if it is not of the same size of the vector to index
y <- c(TRUE,FALSE,FALSE,FALSE,TRUE) y <- c(TRUE,FALSE,FALSE,FALSE,TRUE)
x[y] x[y]
...@@ -972,7 +972,7 @@ x <- c(1,5,7,8,15) ...@@ -972,7 +972,7 @@ x <- c(1,5,7,8,15)
x[1] <- 3 x[1] <- 3
x x
x[x>5] <- 5 x[x>5] <- 13
x x
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment