Skip to content

Imrpove the managing of calls to eval in randtest.rlq #21

@sdray

Description

@sdray

The issue appears when a table is named T (e.g., for traits). In this case, the randtest.rlq methods (but it should be the same for other methods that use 'eval' to retrieve objects) wrongly evaluates the object (as TRUE instead of the data.frame) but the code runs wrongly without returning any error.

E <- data.frame(matrix(rnorm(30), nrow = 15))
T <- data.frame(matrix(rnorm(30), nrow = 10))
L <- data.frame(matrix(rpois(lambda = 15, 150), nrow = 15))
coa <- dudi.coa(L, scannf = FALSE)
pcaT <- dudi.pca(T, row.w = coa$cw, scannf = FALSE)
pcaE <- dudi.pca(E, row.w = coa$lw, scannf = FALSE)
rlq1 <- rlq(pcaE, coa, pcaT, scannf = FALSE)
sum(rlq1$eig)
randtest(rlq1)

Solution would be to correctly manage the original object T or at least returns an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions