Learn R Programming

rPref (version 0.4)

show.pref: Show a (partially evaluated) preference

Description

Show a (partially evaluated) preference

Usage

show.pref(p, df = NULL)

Arguments

p
The preference to be shown.
df
(Optional) A dataframe on which the preference operates.

Details

If df is not given this function is identical to typing p on the console or calling show(p). This standard show function does not do any evaluation and just converts the expressions to characters. A given dataframe causes that all expressions in p are evaluated except the attributes in p, i.e. the column names in df. The content of the dataframe df does not matter; only colnames(df) is taken to get the "free variables" in p

Examples

Run this code
f <- function(x) 2*x
p <- true(cyl == f(1))

# prints 'cyl == f(x)'
p

# prints 'cyl == 2'
show.pref(p, mtcars)

Run the code above in your browser using DataLab