newdata: Returns a prediction 'data.frame' for newdata argument in...

Description Usage Arguments Details Value

View source: R/newdata.R

Description

Function returns a data.frame with one variable varying and the others fixed at their mean values or their most common level.

Usage

1
newdata(x, var, fun = mean, n = 50)

Arguments

x

A data.frame. Should add the possibility to extract the model.frame from a model.

var

The name of the variable to build a prediction data.frame with

fun

The function to apply to numerical variables

n

The number of values to predict

Details

When factors are given, an effort is made to put the same factors in the resulting data.frame. Not sure that the code would work for non-factor categorical variable for now.

Value

A data.frame


frousseu/FRutils documentation built on April 8, 2021, 3:03 p.m.