Learn R Programming

pmml (version 2.5.2)

xform_wrap: Wrap data in a data transformations object.

Description

Wrap data in a data transformations object.

Usage

xform_wrap(data, use_matrix = FALSE)

Arguments

data

The raw data set.

use_matrix

Boolean value indicating whether data should be stored in matrix format as well.

Value

An R object containing information on the data to be transformed.

Details

Wrap raw data read in an R object. This object can then be passed to various transform functions, and the data in it transformed.

The object consists of the data itself and various properties for each data variable. Since the data is not always required to be in matrix format as well as a data frame, the 'use_matrix' value lets the user decide if the data should be stored in both formats, giving the user a choice in reducing the speed of the transformation operations and the memory required. If there is not enough information about the data, they are given default values; the data is assumed to be the original data of data type string. The variable names are assumed to be X1, X2, ... This information is then used by the transformation functions to calculate the derived variable values.

See Also

pmml

Examples

Run this code
# NOT RUN {
# Load the standard iris dataset
data(iris)

# Make a object for the iris dataset to use with
# transformation functions
iris_box <- xform_wrap(iris)

# Output only the transformations in PMML format.
# This example will output just an empty "LocalTransformations"
# element as no transformations were performed.
trans_pmml <- pmml(NULL, transforms = iris_box)

# The following will also work
trans_pmml_2 <- pmml(, transforms = iris_box)
# }

Run the code above in your browser using DataLab