Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

makeDesign

make a uniform, random, or user-specified grid over some columns of a data.frame, and combine it with a grid of points to integrate over.


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

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

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

Monte-Carlo Methods for Prediction Functions

v0.0.5
MIT + file LICENSE
Authors
Zachary Jones [aut, cre]
Initial release
2018-10-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.