This example uses the data set pima7.dt which contains seven objects of the pima data set. It is already included in the RoughSets package. Therefore, we load it with:
R> data(RoughSetData)
R> pima7.dt <- RoughSetData$pima7.dt


As in the RST case, we need to compute the indiscernibility relation, approximations and positive region in order. First, we calculate the indiscernibility relation of considered considitional and decision attributes. For example, in this case we consider the second and third attributes only (condAttr ) and the last column as the decision attribute (decAttr ).
R> condAttr <- c(2, 3)
R> decAttr <- ncol(pima7.dt)


Then, we need to assign values of the control parameter. For the indiscernibility on the conditional attributes (the second and third attributes only), we set lukasiewicz and eq.1 to be our t-norm and relation, respectively. Detailed description about parameters can be found in the package manual.
R> control.ind <- list(type.aggregation = c("t.tnorm", "lukasiewicz"),
+ type.relation = c("tolerance", "eq.1"))
R> IND.condAttr <- BC.IND.relation.FRST(pima7.dt, attributes = condAttr,
+ control = control.ind)


Since our data have nominal values in the decision attribute, we assign crisp for the type of aggregation and relation.
R> control.dec <- list(type.aggregation = "crisp", type.relation = "crisp")
R> IND.decAttr <- BC.IND.relation.FRST(pima7.dt, attributes = decAttr,
+ control = control.dec)


R> print(IND.condAttr)
$IND.relation
   1                2              3              4                  5                6

1 1.00000000 0.0000000 0.0673913 0.000000000 0.03913043 0.606521739
2 0.00000000 1.0000000 0.1173913 0.330434783 0.12391304 0.000000000
3 0.06739130 0.1173913 1.0000000 0.547826087 0.00000000 0.460869565
4 0.00000000 0.3304348 0.5478261 1.000000000 0.00000000 0.008695652
5 0.03913043 0.1239130 0.0000000 0.000000000 1.00000000 0.345652174
6 0.60652174 0.0000000 0.4608696 0.008695652 0.34565217 1.000000000
7 0.53478261 0.0000000 0.4021739 0.000000000 0.39565217 0.841304348
   7
1 0.5347826
2 0.0000000
3 0.4021739
4 0.0000000
5 0.3956522
6 0.8413043
7 1.0000000
$type.relation
$type.relation$type
[1] "tolerance"
$type.relation$equation
[1] "eq.1"
$type.aggregation
t.aggregation t.tnorm
"t.tnorm" "lukasiewicz"
$type.model
[1] "FRST"
attr(,"class")
[1] "IndiscernibilityRelation" "list"

R> print(IND.decAttr)
$IND.relation
   1 2 3 4 5 6 7
1 1 0 1 0 1 1 1
2 0 1 0 1 0 0 0
3 1 0 1 0 1 1 1
4 0 1 0 1 0 0 0
5 1 0 1 0 1 1 1
6 1 0 1 0 1 1 1
7 1 0 1 0 1 1 1

$type.relation
[1] "crisp"
$type.aggregation
[1] "crisp"
$type.model
[1] "FRST"
attr(,"class")
[1] "IndiscernibilityRelation" "list"

After obtaining the relations on the conditional and decision attributes, we can calculate the lower and upper approximations as:
R> control <- list(t.implicator = "lukasiewicz")
R> imp.tnorm <- BC.LU.approximation.FRST(pima7.dt, IND.condAttr, IND.decAttr,
+ type.LU = "implicator.tnorm", control = control)


R> print(imp.tnorm)
$fuzzy.lower
$fuzzy.lower$1
1              2               3              4              5              6               7
1.0000000 0.0000000 0.4521739 0.0000000 0.8760870 0.9913043 1.0000000
$fuzzy.lower$2
1              2               3              4              5              6               7
0.0000000 0.8760870 0.0000000 0.4521739 0.0000000 0.0000000 0.0000000
$fuzzy.upper
$fuzzy.upper$1
1               2              3              4              5              6               7
1.0000000 0.1239130 1.0000000 0.5478261 1.0000000 1.0000000 1.0000000
$fuzzy.upper$2
1                  2                  3                  4                 5
0.000000000 1.000000000 0.547826087 1.000000000 0.123913043
6                  7
0.008695652 0.000000000
$type.LU
[1] "implicator.tnorm"
$type.model
[1] "FRST"

attr(,"class")
[1] "LowerUpperApproximation" "list"


It can be seen that in this case we use implicator.tnorm proposed by with lukasiewicz as the implicator operator. The imp.tnorm object is a list showing each index of objects included in lower and upper approximations based on decision concepts. The positive region and degree of dependency can be obtained with:
R> region <- BC.positive.reg.FRST(pima7.dt, imp.tnorm)
R> print(region)
$positive.freg
[1] 1.0000000 0.8760870 0.4521739 0.4521739 0.8760870 0.9913043
[7] 1.0000000
$degree.dependency
[1] 0.8068323
$type.model
[1] "FRST"
attr(,"class")
[1] "PositiveRegion" "list"

Last, we can construct the decision-relative discernibility matrix. For example, we use the following parameters.
R> control.1 <- list(type.relation = c("tolerance", "eq.1"),
+ type.aggregation = c("t.tnorm", "min"),
+ t.implicator = "lukasiewicz", type.LU = "implicator.tnorm")


The detailed explanation can be found in the manual. Then, we construct the matrix based on the standard.red.
R> disc.Mat <- BC.discernibility.mat.FRST(pima7.dt, type.discernibility =
+ "standard.red",control = control.1)
R> print(disc.Mat)
$disc.mat
NULL
$disc.list
$disc.list[[1]]
[1] "preg" "plas" "pres" "insu" "age"
$disc.list[[2]]

[1] "preg" "plas" "insu"
$disc.list[[3]]
[1] "pres"
$disc.list[[4]]
[1] "preg"
$disc.list[[5]]
[1] "preg" "age"
$disc.list[[6]]
[1] "age"
$disc.list[[7]]
[1] "pedi"
$disc.list[[8]]
[1] "plas"
$disc.list[[9]]
[1] "preg" "plas" "insu" "pedi" "age"
$disc.list[[10]]
[1] "preg" "plas" "insu" "pedi"
$disc.list[[11]]
[1] "preg" "plas" "pres" "age"
$disc.list[[12]]
[1] "preg" "plas"
$disc.list[[13]]
[1] "preg" "plas" "insu" "mass"
$names.attr
[1] "preg" "plas" "pres" "skin" "insu" "mass" "pedi" "age"
[9] "class"
$type.discernibility
[1] "standard.red"
$type.model
[1] "FRST"

attr(,"class")
[1] "DiscernibilityMatrix" "list"