Skip to content

Commit

Permalink
housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
aljabadi committed Jun 17, 2021
1 parent bf2401b commit 4483516
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mixOmics
Type: Package
Title: Omics Data Integration Project
Version: 6.17.17
Version: 6.17.18
Depends: R (>= 3.5.0),
MASS,
lattice,
Expand Down
8 changes: 5 additions & 3 deletions R/helpers-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@
if (nlevels(group) == 1)
{
col.per.group <- ifelse(is.null(col), color.mixo(1), .are.colors(col))
}
else
{ ## group is of length >= 2
} else if (nlevels(group) < 10)
{
col.per.group <- color.mixo(seq_len(nlevels(group)))
} else if (nlevels(group) >= 10)
{
col.per.group <- color.jet(nlevels(group))
}

names(col.per.group) <- levels(group)
Expand Down
3 changes: 1 addition & 2 deletions R/plotIndiv.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
#' for ellipse plots. Coded as default for the supervised methods \code{PLS-DA,
#' SPLS-DA,sGCCDA}, but needs to be input for the unsupervised methods
#' \code{PCA, sPCA, IPCA, sIPCA, PLS, sPLS, rCC, rGCCA, sGCCA}
#' @param col.per.group character (or symbol) color to be used when 'group' is
#' defined. Vector of the same length as the number of groups.
#' @template arg/col.per.group
#' @param style argument to be set to either \code{'graphics'},
#' \code{'lattice'}, \code{'ggplot2'} or \code{'3d'} for a style of plotting.
#' Default set to 'ggplot2'. See details. \code{3d} is not available for MINT
Expand Down
16 changes: 7 additions & 9 deletions R/selectVar.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,13 @@ selectVar.sgcca <- selectVar.mixo_pls
selectVar.rgcca <- selectVar.mixo_pls

## -------------------------------- helper -------------------------------- ##
get.name.and.value=function(x,comp)
get.name.and.value <- function(x,comp)
{
if(length(x[,comp,drop=FALSE]) > 1)
{
name.var = names(sort(abs(x[,comp]), decreasing = TRUE)[1:sum(x[,comp]!=0)])
} else {
name.var = rownames(x) # when only one number, sort loses the name of the variable
}
value.var=x[name.var,comp]
return(list(name = name.var, value = data.frame(value.var)))
value <- data.frame(value.var = x[,comp])
value <- value[abs(value$value.var) > .Machine$double.eps,,drop=FALSE]
value <- value[order(-abs(value$value.var)),,drop=FALSE]

name.var <- rownames(value)
return(list(name = name.var, value = value))
}

0 comments on commit 4483516

Please sign in to comment.