Warning message for missing values during plotIndiv() for PCA

Hello! I am having another seemingly simple problem – when I try to plot PCA diagrams using plotIndiv() I keep receiving error messages that the values are missing.

I start out by carrying out CLR transformation on filtered and offsetted data:

En.AllGen.clr <- logratio.transfo(as.matrix(En.AllGen.keep), logratio = 'CLR', offset = 0)

Then I carry out PCA and plot the PCA diagram:

En.AllGen.pca <- pca(En.AllGen.clr)
plotIndiv(En.AllGen.pca, group = SampleTypes, ind.names = FALSE, pch = 16, legend = TRUE, title = "Enfield PCA")

SampleTypes is a factor with 5 levels for the sample types in my study:

> str(SampleTypes)
Factor w/ 5 levels "Control","Crude oil",..: 3 3 4 4 4 2 5 5 1 1 ...

However, I have been consistently getting the following warning messages when I try to plotIndiv() for PCA:

Warning messages:
1: Removed 5 rows containing missing values (geom_point).
2: Removed 1 rows containing missing values (geom_point).
3: Removed 2 rows containing missing values (geom_point).
4: Removed 3 rows containing missing values (geom_point).
5: Removed 2 rows containing missing values (geom_point).

Each index (1 to 5) correspond to the five sample types in my dataset, and each the rows removed refer to the individual samples.

However, I only started encountering this issue after I updated my version of R to V3.6.3, so I am not sure if it is an issue with my code or package/version compatibility. I am still able to reproduce the code without errors if I run the script on my personal computer (I work mainly from my office computer). I’m wondering if this is an issue that you may have encountered before?

Thanks very much for your time.

Hi @dscheah,

Thanks for reporting this. This seems to be a ggplot2 update issue. I created a fix in the GitHub devel version. I’d appreciate if you install the latest development version(https://github.com/mixOmicsTeam/mixOmics#installation) and let me know if the problem persists.

Best wishes,

Al

Hi @aljabadi, thanks for your reply. I attempted to install the development version as follows:

# install devtools
if (!requireNamespace("devtools", quietly = TRUE))
install.packages("devtools")

# load devtools
library("devtools")

# install mixOmics
devtools::install_github("mixOmicsTeam/mixOmics", ref = "devel")

The installation asked if I wanted to update dependency packages, for which I selected “all”:

These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: dplyr (0.8.4 -> 0.8.5) [CRAN]
5: rlang (0.4.4 -> 0.4.5) [CRAN]
6: vctrs (0.2.2 -> 0.2.4) [CRAN]
7: plyr (1.8.5 -> 1.8.6) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
1
dplyr (0.8.4 -> 0.8.5) [CRAN]
rlang (0.4.4 -> 0.4.5) [CRAN]
vctrs (0.2.2 -> 0.2.4) [CRAN]
plyr (1.8.5 -> 1.8.6) [CRAN]
Installing 4 packages: dplyr, rlang, vctrs, plyr

There are binary versions available but the source versions are later:
binary source needs_compilation
dplyr 0.8.4 0.8.5 TRUE
vctrs 0.2.3 0.2.4 TRUE
plyr 1.8.5 1.8.6 TRUE

However, the installation could not complete as one of the packages seemingly could not be downloaded:

Error: Failed to install 'mixOmics' from GitHub:
(converted from warning) cannot remove prior installation of package ‘rlang’

I also tried to install the package by selecting “none” of the packages to update, but the downloaded still attempted to install rlang:

These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: dplyr (0.8.4 -> 0.8.5) [CRAN]
5: vctrs (0.2.2 -> 0.2.4) [CRAN]
6: plyr (1.8.5 -> 1.8.6) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
3
Installing 1 packages: rlang
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/rlang_0.4.5.zip'
Content type 'application/zip' length 1129637 bytes (1.1 MB)
downloaded 1.1 MB

package ‘rlang’ successfully unpacked and MD5 sums checked
Error: Failed to install 'mixOmics' from GitHub:
(converted from warning) cannot remove prior installation of package ‘rlang’

Woud this be an issue with the my code or the installation?

Thanks!

Hi @dscheah,

That could be very system dependent so I’m not sure. You can try not updating other packages at this stage so you can evaluate the new fix. You can see the following issue to see if it resolves your problems:

Alternatively, you can just google the error message: cannot remove prior installation of package ‘rlang’

Best wishes,

Al