knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of WTSNE is to ...
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("chenxuepu/WTSNE")
This is a basic example which shows you how to solve a common problem:
library(WTSNE) library(ggplot2) library(MASS) ## basic example code
iris_uni <- unique(iris) iris_lda <- MASS::lda(Species~.,iris_uni) iris_p <- predict(iris_lda,iris_uni)$posterior iris_p_max <- apply(iris_p,1,max) good_fit <- (iris_p_max > quantile(iris_p_max,0.50)) weight <- ifelse(good_fit,2,1) set.seed(123) iris_tsne <- WTSNE(iris_uni[,1:4],weight=weight) y <- as.data.frame(iris_tsne$Y) y <- cbind(y,iris_uni$Species) names(y) <- c("x","y","Species") ggplot(y,aes(x=x,y=y,color = Species)) + geom_point()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.