PCAtools
PCAtools copied to clipboard
eigencoreplot error
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?
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.