Skip to content
RDocumentation: barycentre
  • AI Chat
  • Code
  • Report
  • Note that this notebook was automatically generated from an RDocumentation page. It depends on the package and the example code whether this code will run without errors. You may need to edit the code to make things work.

    if(!require('clustComp')) {
        install.packages('clustComp')
        library('clustComp')
    }
    Run cancelled
        # simulated data
        clustering1 <- c(rep(1, 5), rep(2, 10), rep(3, 10))
        clustering2 <- c(rep(1, 6), rep(2, 6), rep(3, 4), rep(4, 9))
        weights <- table(clustering1, clustering2)
        barycentre(weights[1, ], 1:4)
        barycentre(weights[1, ])
        barycentre(weights[2, ], 1:4)
        apply(weights, 1, barycentre, 1:4)