Learn R Programming

kappalab (version 0.4-0)

set.func-class: Class "set.func"

Description

Class representing a set function.

Arguments

Objects from the Class

Objects can be created by calls to the function set.func.

Extends

Class superclass.set.func, directly.

See Also

set.func, as.game-methods, as.capacity-methods, as.card.set.func-methods, as.Mobius.set.func-methods, as.Mobius.card.set.func-methods, conjugate-methods, interaction.indices-methods, is.cardinal-methods, is.kadditive-methods, is.monotone-methods, k.truncate.Mobius-methods, Mobius-methods, Shapley.value-methods, to.data.frame-methods.

Examples

Run this code
## a set function
mu <- set.func(c(1:8,8:1)/8)

## the attributes of the object
mu@n
mu@data
mu@subsets

## some conversions that cannot work
as.game(mu)
as.capacity(mu)
as.card.set.func(mu)

## some tests
is.cardinal(mu)
is.kadditive(mu,2)
is.monotone(mu)

## some transformations
conjugate(mu)
Mobius(mu)
k.truncate.Mobius(mu,2)

## summary 
Shapley.value(mu)
interaction.indices(mu)
# the same
summary(mu)

## save the set function to a file
d <- to.data.frame(mu)
write.table(d,"my.set.func.csv",sep="t")

# finally, some conversions that should work
mu <- set.func(c(0,1,1,1,2,2,2,3))
as.game(mu)
as.capacity(mu)
as.card.set.func(mu)

Run the code above in your browser using DataLab