Learn R Programming

DEXiR (version 1.0.2)

rule_values: rule_values

Description

Values of decision rules are in .dxi files encoded using character strings, where each individual character encodes some function value. The encoding is zero-based, so that the character "0" represents the lowest ordinal number on the corresponding discrete scale. Encoding of characters is according to ASCII, starting with "0". rule_values(str) converts the character string to a numeric vector of corresponding ordinal values.

Usage

rule_values(str, add = 0)

Value

A numeric vector of the same length as str.

Arguments

str

character(1), a DEXi encoding of a vector of ordinal numbers.

add

An integer constant to be added to the resulting vector. The default is add = 0, however DEXi's ordinal numbers should normally be converted to R's using add = 1.

Examples

Run this code
rule_values("01122:")
rule_values("01122:", add = 1)

Run the code above in your browser using DataLab