R/sparse_concept.R
Concept.Rd
This class implements the data structure and methods for fuzzy concepts.
print()
Prints the concept to console
# Build a formal context and find its concepts
fc_planets <- FormalContext$new(planets)
#> Warning: unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
#> dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 0x0006): Library not loaded: '/opt/X11/lib/libSM.6.dylib'
#> Referenced from: '/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/modules/R_X11.so'
#> Reason: tried: '/opt/X11/lib/libSM.6.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libSM.6.dylib' (no such file), '/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.372-7/x64/Contents/Home//lib/server/libSM.6.dylib' (no such file)
fc_planets$find_concepts()
# Print the first three concepts
fc_planets$concepts[1:3]
#> A set of 3 concepts:
#> 1: ({Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}, {})
#> 2: ({Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}, {moon})
#> 3: ({Jupiter, Saturn, Uranus, Neptune, Pluto}, {far, moon})
# Select the first concept:
C <- fc_planets$concepts$sub(1)
# Get its extent and intent
C$get_extent()
#> {Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}
C$get_intent()
#> {}