make.formula: Make a formula using given target and input attributes

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

View source: R/r-utility-make-formula.R

Description

This function creates a formula object for R modeling with a given target attribute name and a set of input attribute names. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.

Usage

1

Arguments

y.var

a character string specifying the target attribute name

x.vars

a character vector specifying the set of input attribute names

Details

The x.vars argument can be also ".", specifying that all non-target attributes should be used as input attributes. Only simple single-attribute terms combined using the + operator are used in the created formula.

Value

A formula y~x1+x2+... where y denotes the target attribute name and x1, x2, ... denote the input attribute names, or y~. if x.vars==".".

Author(s)

Pawel Cichosz <p.cichosz@elka.pw.edu.pl>

See Also

x.vars, y.var

Examples

1
2
3
4
data(weather, package="dmr.data")

make.formula(names(weather)[5], names(weather)[1:3])
make.formula(names(weather)[5], ".")

42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.