PCAtools icon indicating copy to clipboard operation
PCAtools copied to clipboard

eigencoreplot error

Open AnjaliS1 opened this issue 2 years ago • 1 comments

Hi, I'm trying to use the eigencorplot function and this error appeared: Error in if (abs(max) > abs(min)) { : missing value where TRUE/FALSE needed.

Is there something I can do about this?

AnjaliS1 avatar Feb 09 '24 13:02 AnjaliS1

This is likely due to the correlation between at least one of the PCs and at least one of your metavars being NA and specifying scale = TRUE. This can happen if one of your metavars (i.e. p$metadata) is identical across all samples. E.g

patient condition age cancer_stage
a tumour 45 1
a normal 45 1
b tumour 65 1
b normal 65 1

Exclude cancer_stage from metavars when you call eigencorplot and the problem should be solved.

kevinpryan avatar Jun 13 '24 14:06 kevinpryan