Learn R Programming

SAFD (version 0.3)

translator: Translator

Description

The function first calls checking2 in order to check if the input data X defines a polygonal fuzzy number. If all conditions are satisfied the function transforms the input X into a dataframe with the chosen number nl of levels (default is nl=101) by doing linear interpolation, and returns this dataframe.

Usage

translator(X, nl = 101)

Arguments

X
...dataframe for which checking2 yields 1
nl
...number of levels of the output dataframe (fuzzy number), by default 101, must be at least 2.

Value

  • comp1In case checking2(X)=1 translator returns a dataframe (fuzzy number) with nl number of alpha-levels, otherwise the input is returned unchanged.

Details

See examples

See Also

See Also as checking2, checking

Examples

Run this code
#example1:
X<-data.frame(cbind(x=c(-2,-0.75,-0.25,0.5,1),alpha=c(0,0.3,1,0,0.3)))
E<-translator(X,4)
E

#example2
X<-data.frame(cbind(x=c(-2,-0.75,-0.25,0.5,1),alpha=c(0,0.6,1,1,0)))
E<-translator(X,3)
head(E)
plot(X,type="l")
lines(E,type="l",col="red")

#example3
data(XX)
E<-translator(XX[[3]],11)
plot(XX[[3]],type="l")
lines(E,type="l",col="red")

Run the code above in your browser using DataLab