fcm object with additional slots, described below. — fcm-class" />
fcm-class.RdVirtual class "fcm" for a feature co-occurrence matrix The fcm class of object is a special type of fcm object with additional slots, described below.
# S4 method for fcm t(x) # S4 method for fcm,numeric Arith(e1, e2) # S4 method for numeric,fcm Arith(e1, e2) # S4 method for fcm,index,index,missing [(x, i, j, ..., drop = TRUE) # S4 method for fcm,index,index,logical [(x, i, j, ..., drop = TRUE) # S4 method for fcm,missing,missing,missing [(x, i, j, ..., drop = TRUE) # S4 method for fcm,missing,missing,logical [(x, i, j, ..., drop = TRUE) # S4 method for fcm,index,missing,missing [(x, i, j, ..., drop = TRUE) # S4 method for fcm,index,missing,logical [(x, i, j, ..., drop = TRUE) # S4 method for fcm,missing,index,missing [(x, i, j, ..., drop = TRUE) # S4 method for fcm,missing,index,logical [(x, i, j, ..., drop = TRUE)
| x | the fcm object |
|---|---|
| e1 | first quantity in "+" operation for fcm |
| e2 | second quantity in "+" operation for fcm |
| i | index for features |
| j | index for features |
| ... | additional arguments not used here |
| drop | always set to |
contextthe context definition
windowthe size of the window, if context = "window"
counthow co-occurrences are counted
weightscontext weighting for distance from target feature, equal in length to window
margintriwhether the lower triangle of the symmetric \(V \times V\) matrix is recorded
orderedwhether a term appears before or after the target feature are counted separately
# fcm subsetting y <- fcm(tokens(c("this contains lots of stopwords", "no if, and, or but about it: lots"), remove_punct = TRUE)) y[1:3, ]#> Feature co-occurrence matrix of: 3 by 12 features. #> 3 x 12 sparse Matrix of class "fcm" #> features #> features this contains lots of stopwords no if and or but about it #> this 0 1 1 1 1 0 0 0 0 0 0 0 #> contains 0 0 1 1 1 0 0 0 0 0 0 0 #> lots 0 0 0 1 1 1 1 1 1 1 1 1y[4:5, 1:5]#> Feature co-occurrence matrix of: 2 by 5 features. #> 2 x 5 sparse Matrix of class "fcm" #> features #> features this contains lots of stopwords #> of 0 0 0 0 1 #> stopwords 0 0 0 0 0