debug_plot <- function( m, km=NULL, P=NULL ) {
chart( m )
km <- if( is.null( km ) ) rep( 1, vct( m ) ) else km
ks <- unique( km )
cols <- color_make()( length( ks ) )
for( i in 1:length( ks ) ) {
k <- ks[i]
m0 <- m[ k == km, ]
graphics::polygon( p_hull( m0 ), border=cols[i] )
graphics::text( C( m0 ), col=cols[i], labels=k, cex=.8 )
}
if( !is.null( P ) ) {
graphics::polygon( p_hull( P ), border='red', lwd=2 )
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.