newdata: Construct a data frame suitable for prediction

Description Usage Arguments Details Examples

Description

Given a data set, returns a data frame type object that can be used as newdata argument in a call to predict and similar functions.

Usage

1
2
3
4
5
6
7
make_newdata(x, ...)

## Default S3 method:
make_newdata(x, ..., expand = NULL, n = 50L)

## S3 method for class 'ped'
make_newdata(x, ..., expand = NULL, n = 50L)

Arguments

x

A data frame (or object that inherits from data.frame).

...

Further specifications of variables that should be set to a specific values.

expand

A character vector of column names in ped.

n

If expand specified, respective variables will be expanded in n values from minimum to maximum.

Details

Extracts information from ped, using sample_info. If variables are specified with specific values in ..., the values in from sample_info will be overwritten. If variables are provided in expand, these will be expanded from min to max using in n equidistant steps.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(dplyr)
iris %>% make_newdata()
iris %>% make_newdata(Sepal.Length=5)
iris %>% make_newdata(Sepal.Length=c(5, 10), Sepal.Width=c(5, 5.1, 5.2))
iris %>% make_newdata(Sepal.Length=c(5, 10), expand="Sepal.Width", n=5)
iris %>% group_by(Species) %>%
  make_newdata(Sepal.Length=c(5, 10), expand="Sepal.Width", n=5) %>%
  print(n=30)

## End(Not run)

adibender/pamm documentation built on May 14, 2019, 5:22 p.m.