tshmak/crosspred

Cannot find read.table2() function

DracoLloigor opened this issue · 4 comments

Hi!
I was using computer cluster's R to run lassosum and crosspred, and I have the following command

library(lassosum)
library(crosspred)
pl <- cp.plink.linear(bfile = bfile, covar = cov, nfold=5)

*bfile is defined as bfile < "some_name"

and I encountered the error of:

Error in read.table2(parsed$famfile) :
could not find function "read.table2"

I load lassosum already , and I checked the version and made sure it's 0.4.5;
I tried to call the function separately

read.table2()
Error in read.table2() : could not find function "read.table2"
lassosum::read.table2()
Error: 'read.table2' is not an exported object from 'namespace:lassosum'

and it cannot find the function.

I tried to enter the pheno manually, with the pheno being a vector, and it still reported as unequal length (however both my bfiles ahve 461 participants and so does the vector).

Can you help me debug? Thank you so much!!

Hm... I think it's a bug: I just did a quick fix. Please see if it works: 0279a92

After the fix it worked! Thank you so much!

I have one more question related to the "covar" option in pl <- cp.plink.linear(bfile = bfile, covar = cov, nfold=5)

I get the error message:
Error in parse.pheno.covar(covar, parsed) : Don't know what to do yet...

I looked into your script and found it need a dataframe with FID and IID and covariates present. My covar dataframe looks like this:
image
and I couldn't figure out why it says Don't know what to do yet.

Thank you again for the fix and Help!

If your covar is a data.frame, it should be processed here. If it says "Don't know what to do yet...", it means it's not a file and it's not a vector/matrix/data.frame... You can run class(covar) to see what class your input is and check if it's a vector/matrix/data.frame.

Thank you for the help!!