Learn R Programming

Calculator.LR.FNs (version 1.3)

sign: Sign of LR fuzzy number

Description

To distinguish and determining the sign of a LR fuzzy number one can use from this function. In other words, the function sign is able to categorize the class of all LR fuzzy numbers into three kinds positive, negative and non of them (non-positive and non negative).

Usage

sign(M)

Arguments

M

A LR, RL or L fuzzy number

Value

The "sign" function only return three charactical values: "Positive", "Negative" or "non-positive and non negative".

Examples

Run this code
# NOT RUN {
Left.fun  = function(x)  { (1-x)*(x>=0)}

M = L(2,4,3)
support(M)
sign(M)

sign( L(5,4,3) )

( sign( L(5,4,3) ) == "Positive" )

## The function is currently defined as
function (M) 
{
    supp = support(M)
    if (supp[1] > 0) {
        return(noquote(paste0("Positive")))
    }
    else {
        if (supp[2] < 0) {
            return(noquote(paste0("Negative")))
        }
        else {
            return(noquote(paste0("non-positive and non negative")))
        }
    }
  }
# }

Run the code above in your browser using DataLab