Learn R Programming

FuzzyStatTraEOO (version 1.0)

Utils: 'Utils' to convert real data into the corresponding 'StatList'.

Description

'Utils' contain an auxiliary method that perform the conversion of an archive with rda extension (R Data File), that contains real data, to the corresponding 'TrapezoidalFuzzyNumberList'.

Arguments

Author

Andrea Garcia Cernuda <uo270115@uniovi.es>

Methods


Method convertTra()

This method generates n 'TrapezoidalFuzzyNumbers' contained in a 'TrapezoidalFuzzyNumberList' obtained from the rows and columns of R Data File. If the data contains any NA value, the row will be deleted as a 'TrapezpidalFuzzyNumber' have to be created with double values.

Usage

Utils$convertTra(d = NA)

Arguments

d

is the R Data File already loaded in the environment with data("example"). If the user wants to use M1, M2, M3 or S1, they are already loaded in the package environment through the archive data.R.

Details

See examples.

Returns

a TrapezoidalFuzzyNumberList with n TrapezoidalFuzzyNumbers. Each one is characterized by its four values inf0, inf1, sup1, sup0. The TrapezoidalFuzzyNumbers are obtained from the rows and columns of R Data File. If the body's method inner conditions are not met, NA will be returned.

Examples

# Example 1:
Utils$new()$convertTra(M1)

# Example 2: Utils$new()$convertTra(M2)

# Example 3: Utils$new()$convertTra(M3)

# Example 4: Utils$new()$convertTra(S1)

# Example 5: m=as.data.frame(matrix(c(NA, 1, 2, NA, 3, 2,2,NA,1,3,NA,NA,6,4,NA,NA),ncol=4)) Utils$new()$convertTra(m)


Method clone()

The objects of this class are cloneable with this method.

Usage

Utils$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code

## ------------------------------------------------
## Method `Utils$convertTra`
## ------------------------------------------------

# Example 1:
Utils$new()$convertTra(M1)

# Example 2:
Utils$new()$convertTra(M2)

# Example 3:
Utils$new()$convertTra(M3)

# Example 4:
Utils$new()$convertTra(S1)

# Example 5:
m=as.data.frame(matrix(c(NA, 1, 2, NA, 3, 2,2,NA,1,3,NA,NA,6,4,NA,NA),ncol=4))
Utils$new()$convertTra(m)

Run the code above in your browser using DataLab