Skip to content
Prev 305305 / 398506 Next

How to resolve the following error: (list) object cannot be coerced to type 'double'

On Wed, Sep 12, 2012 at 4:04 PM, Jason Love <jason.love1492 at gmail.com> wrote:
Untested (because I'm still without respectable internet after a move)
I believe rcorr would rather have a matrix than a data.frame(), which
is what read.csv produces, so try

Var <- as.matrix(Var)

or

rcorr(as.matrix(Var), type = "pearson")
This suggests that the input to rcorr is being converted to a double,
which isn't a valid storage.mode change for a list (= data frame).

Cheers,
M