df_to_deal: Convert data frame to deal

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert data frame to deal

Usage

1
df_to_deal(df, names_from = NULL)

Arguments

df

data frame of 3 columns: gamble id, outcome x and corresponding probability p

names_from

character name of the column, containing gamble id. If missing, it will be a first column other than p and x

Value

deal

Examples

1
2
3
4
5
df <- data.frame(g=c("G1","G2","G2"),
                 x=c(100, 200, 50),
                 p=c(1, 0.5, 0.5)
)
df_to_deal(df)

dmi3kno/deals documentation built on Dec. 11, 2019, 12:07 p.m.