The goal of resampling is to build variations of a single grid.
Two variants are implemented: The first is the *leave-n-out* approach which
builds all possible grids when dropping n constructs. The second is a
*bootstrap* approach, randomly drawing n constructs from the grid.

## Usage

```
grids_leave_n_out(x, n = 0)
grids_bootstrap(x, n = nrow(x), reps = 100, replace = TRUE)
```

## Arguments

- x
A repgrid object.

- n
Number of constructs to drop or to sample in each generated grid.

- reps
Number of grids to generate.

- replace
Resample constructs with replacement?

## Examples

```
## All results for PVAFF index when one construct is left out
p <- indexPvaff(boeker)
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
l <- grids_leave_n_out(boeker, n = 1)
pp <- sapply(l, indexPvaff) # apply indexPvaff function to all grids
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
#> Note: As of v0.1.14 PVAFF is derived using PCA of the construct centered ratings by default.Before that the construct correlation matrix was used (see method=2).
#>
range(pp) # min and max PVAFF
#> [1] 0.3659271 0.4505245
hist(pp, xlab = "PVAFF values") # visualize
abline(v = p, col = "blue", lty = 2)
```