Giter VIP home page Giter VIP logo

chameleon's People

Contributors

olivroy avatar orenbenkiki avatar

Watchers

 avatar  avatar

chameleon's Issues

data_colors doesn't return rownames with less than 3 groups

Example:

library(chameleon)
grp <- sample(c("saba", "savta", "dod"), size = nrow(stackloss), replace = TRUE)
chameleon::data_colors(stackloss, groups = grp)
#>       dod      saba     savta
#> "#BE68BC" "#4D976A" "#E0610F"
# Two groups
grp2 <- sample(c("saba", "savta"), size = nrow(stackloss), replace = TRUE)
chameleon::data_colors(stackloss, groups = grp2)
#> [1] "#E69F00" "#0072B2"

This causes MCView to sometimes fail at the import step. @drorbar

data_colors fails when there are less than 3 groups

Example:

data <- data.frame(umap_x = c(17.0890121459961, 13.7146520614624, 
16.1004028320312, 11.98228931427, 14.5449142456055, 16.459436416626, 
15.6826705932617, 16.2683963775635, 9.76927852630615, 10.5458135604858
), umap_y = c(1.55449628829956, 6.1767144203186, -0.520148098468781, 
10.9073801040649, 9.17697143554688, 8.81098747253418, -0.728159248828888, 
7.35069417953491, 10.131459236145, 9.69721508026123), umap_u = c(11.1400880813599, 
12.1072673797607, 10.1809425354004, 9.63253021240234, 9.83402347564697, 
9.0894193649292, 9.80254173278809, 10.2694730758667, 10.9983005523682, 
10.9255685806274))

groups <- rep("savta", nrow(data))
chameleon::data_colors(data, groups = groups, run_umap = FALSE)
#> Error in normalized_data(stats::prcomp(data, retx = TRUE)$x): ncol(data) == 3 is not TRUE

When there are 3 groups, everything works perfectly:

groups <- sample(c("savta", "saba", "doda"), size = nrow(data), replace = TRUE)
chameleon::data_colors(data, groups = groups, run_umap = FALSE)
#> doda'#E0610F'saba'#BE68BC'savta'#4D976A'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.