Sorts an fcm in alphabetical order of the features.
fcm_sort(x)
x | fcm object |
---|
A fcm object whose features have been alphabetically sorted.
Differs from fcm_sort
in that this function sorts the fcm by
the feature labels, not the counts of the features.
# with tri = FALSE myfcm <- fcm(tokens(c("A X Y C B A", "X Y C A B B")), tri = FALSE) rownames(myfcm)[3] <- colnames(myfcm)[3] <- "Z" myfcm#> Feature co-occurrence matrix of: 5 by 5 features. #> 5 x 5 sparse Matrix of class "fcm" #> features #> features A X Z C B #> A 1 3 3 3 4 #> X 3 0 2 2 3 #> Z 3 2 0 2 3 #> C 3 2 2 0 3 #> B 4 3 3 3 1fcm_sort(myfcm)#> Feature co-occurrence matrix of: 5 by 5 features. #> 5 x 5 sparse Matrix of class "fcm" #> features #> features A B C X Z #> A 1 4 3 3 3 #> B 4 1 3 3 3 #> C 3 3 0 2 2 #> X 3 3 2 0 2 #> Z 3 3 2 2 0# with tri = TRUE myfcm <- fcm(tokens(c("A X Y C B A", "X Y C A B B")), tri = TRUE) rownames(myfcm)[3] <- colnames(myfcm)[3] <- "Z" myfcm#> Feature co-occurrence matrix of: 5 by 5 features. #> 5 x 5 sparse Matrix of class "fcm" #> features #> features A X Z C B #> A 1 3 3 3 4 #> X 0 0 2 2 3 #> Z 0 0 0 2 3 #> C 0 0 0 0 3 #> B 0 0 0 0 1fcm_sort(myfcm)#> Feature co-occurrence matrix of: 5 by 5 features. #> 5 x 5 sparse Matrix of class "fcm" #> features #> features A B C X Z #> A 1 4 3 3 3 #> B 0 1 3 3 3 #> C 0 0 0 2 2 #> X 0 0 0 0 2 #> Z 0 0 0 0 0