Learn R Programming

cna (version 4.0.0)

fs2cs: Convert fs data to cs data

Description

Convert fuzzy-set (fs) data to crisp-set (cs) data. Works for both a data.frame and a configTable input.

Usage

fs2cs(x, cutoff = 0.5, border = "up", verbose = FALSE)

Value

data.frame or configTable of type cs, depending on input.

Arguments

x

A data frame or configTable of type fs.

cutoff

Minimum membership score required for a factor to count as instantiated in the data and to be integrated in the analysis. Value in the unit interval [0,1]. The default cutoff is 0.5.

border

Character string specifying whether factors with membership scores equal to cutoff are rounded up ("up") or rounded down ("down").

verbose

Logical; if verbose=TRUE and a factor becomes constant, this is reported in a console message.

Details

If the input is a data frame, the output will be, too; and correspondingly for a configTable input. Case frequencies in an input configTable are accounted for.

See Also

configTable

Examples

Run this code

csJob <- configTable(d.jobsecurity)
fs2cs(csJob)

fs2cs(d.jobsecurity) # data.frame

dJob1 <- d.jobsecurity[1, ]
fs2cs(dJob1)         # L=0.57 --> L=1
fs2cs(dJob1, cutoff = 0.6) #  --> L=0
fs2cs(dJob1, cutoff = 0.57) #  --> L=1 (since border="up" by default)
fs2cs(dJob1, cutoff = 0.57, 
      border = "down")     #  --> L=0 

Run the code above in your browser using DataLab