makeDesign: make a uniform, random, or user-specified grid over some...

Description Usage Arguments Value Examples

View source: R/grid.R

Description

makes a uniform, random, or user-specified grid over some columns of a data.frame and takes their Cartesian product with the other columns

Usage

1
makeDesign(data, vars, n, uniform = TRUE, points, int.points)

Arguments

data

a data.frame which must contain vars as well as at least one other column

vars

character vector the columns in data to create the grid for

n

two dimensional integer vector giving the resolution of the grid. the first element gives the grid on vars and the second on the other columns, which are sampled without replacement.

uniform

logical, indicates whether a uniform grid is to be constructed.

points

a named list which gives specific points for vars.

int.points

a integer vector giving indices of the points in data to marginalize over.

Value

a data.frame with at most n dimensions.

Examples

1
2
3
4
5
6
7
data = data.frame(w = seq(0, 1, length.out = 5),
  x = factor(letters[1:5]),
  y = ordered(1:5),
  z = 1:5,
  r = letters[1:5],
  stringsAsFactors = FALSE)
makeDesign(data, "z", c(10, 5), TRUE)

mmpf documentation built on Oct. 24, 2018, 9:04 a.m.