Description Usage Arguments Value Author(s) References See Also Examples

This is a wrapper for the sampling funcions of the vdg package. It extracts design properties from the design passed to it to take appropriate samples.

1 2 |

`n` |
number of points to sample |

`design` |
design for which the sample is required (either a matrix or data frame) |

`type` |
type of design region/sampling method. One of "spherical", "cuboidal",
"lhs", "mlhs", "slhs", "rslhs" or "custom". Option "custom" requires |

`at` |
logical; should sampling be done on the surface of hyperspheres or hypercubes? Not used for LHS methods. |

`custom.fun` |
A custom sampling function, used in conjunction with |

`...` |
other arguments passed to the underlying sampling functions. |

Matrix with samples as rows, with S3 class `smpl`

Pieter C. Schoonees

Pieter C. Schoonees, Niel J. le Roux, Roelof L.J. Coetzer (2016). Flexible Graphical Assessment of
Experimental Designs in R: The vdg Package. *Journal of Statistical Software*, 74(3), 1-22.
doi: 10.18637/jss.v074.i03.

`runif_sphere`

, `runif_cube`

, `LHS`

,
`MLHS`

, `SLHS`

, `RSLHS`

1 2 3 4 5 6 7 8 9 10 11 | ```
## Default spherical design region
set.seed(1896)
samp1 <- sampler(n = 100, design = expand.grid(x = -1:1, y = -1:1))
plot(samp1)
## Supplying a custom sampling function based on lhs::improvedLHS()
library("lhs")
sfun <- function(n, k, dup = 1) 2 * improvedLHS(n, k, dup = dup) - 1
samp2 <- sampler(n = 100, design = expand.grid(x = -1:1, y = -1:1),
type = "custom", custom.fun = sfun)
plot(samp2)
``` |

vdg documentation built on May 29, 2017, 7:18 p.m.

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.