PCAtools icon indicating copy to clipboard operation
PCAtools copied to clipboard

Error with the pca function

Open Pierre9344 opened this issue 2 years ago • 3 comments

Hello,

I get the error next when using the pca function:

> PCAtools::pca(rlog, coldata, removeVar = 0.1)
Erreur : useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.

I got this after updating some packages. I guess this come from the matrixStats package (https://cran.rstudio.com/web/packages/matrixStats/news/news.html).

Can you correct this?

Thank you in advance for your help.

Pierre9344 avatar Dec 14 '23 14:12 Pierre9344

Hi, I am having the same issue. My I ask what is the version you are using for matrixStats?

ozcelikelif avatar Dec 18 '23 17:12 ozcelikelif

@elifozcelik This appears to be defunct in matrixStats 1.2, but may also be universally defunct in R 4.4

I have the same issue. In trying to find a workaround, I discovered that DelayedArray is also complicating this somehow. If I edit the problem line here

vars <- colVars(DelayedArray(mat), center = .center) to vars <- colVars(DelayedArray(mat), center = .center, useNames = T) I continue to get the same error. However, if I remove the DelayedArray wrapper vars <- colVars(mat, center = .center, useNames = T) This works.

I'm not familiar with DelayedArray enough to guess why this is happening. But in the meantime, removing it and adding the useNames specification does work.

lalodragon avatar Dec 21 '23 16:12 lalodragon

Hello, I found a workaround that consist in installing the 1.1 version of the matrixStats package:

remotes::install_github("HenrikBengtsson/matrixStats", ref="1.1.0")

keep in mind that R will propose to update it when installing other package. The fact that we use a "deprecated" version may also cause problem with other packages (I didn't see any for now).

Pierre9344 avatar Feb 27 '24 09:02 Pierre9344