Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find read.table2() function #2

Open
DracoLloigor opened this issue Mar 22, 2024 · 4 comments
Open

Cannot find read.table2() function #2

DracoLloigor opened this issue Mar 22, 2024 · 4 comments

Comments

@DracoLloigor
Copy link

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!!

@tshmak
Copy link
Owner

tshmak commented Mar 25, 2024

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

@DracoLloigor
Copy link
Author

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!

@tshmak
Copy link
Owner

tshmak commented Mar 27, 2024

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.

@DracoLloigor
Copy link
Author

Thank you for the help!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants