View source: R/misc.utilities.R

unwhich | R Documentation |

`TRUE`

in specified positions.This function is basically an inverse of `which`

.

```
unwhich(which, n)
```

`which` |
a numeric vector of indices to set to |

`n` |
total length of the output vector. |

A logical vector of length `n`

whose elements listed in
`which`

are set to `TRUE`

, and whose other elements are set to
`FALSE`

.

```
x <- as.logical(rbinom(10,1,0.5))
stopifnot(all(x == unwhich(which(x), 10)))
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.