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

Error in matrix(NA, nrow = nfolds, ncol = numi2) : invalid 'ncol' value (too large or NA) #61

Open
seasonzhao opened this issue May 4, 2024 · 4 comments

Comments

@seasonzhao
Copy link

Error in matrix(NA, nrow = nfolds, ncol = numi2) : invalid 'ncol' value (too large or NA)

what should I do?
Does anyone encounter this error?

@eacho111
Copy link

Error in matrix(NA, nrow = nfolds, ncol = numi2) : invalid 'ncol' value (too large or NA)

what should I do? Does anyone encounter this error?

Hello!I seem to find this issue. Maybe you have to make sure your phenotype data is conbined with c(1,0).If your phenotype data type is factor, run the next code :phenotype <- as.numeric(as.character(phenotype)) to make sure data with c(1,0).Because this package code will check the data,if both 0 and 1 are existing, code will go on.

@DylanGuo1101
Copy link

Error in matrix(NA, nrow = nfolds, ncol = numi2) : invalid 'ncol' value (too large or NA)
what should I do? Does anyone encounter this error?

Hello!I seem to find this issue. Maybe you have to make sure your phenotype data is conbined with c(1,0).If your phenotype data type is factor, run the next code :phenotype <- as.numeric(as.character(phenotype)) to make sure data with c(1,0).Because this package code will check the data,if both 0 and 1 are existing, code will go on.

It really works!

@zzj2024
Copy link

zzj2024 commented Feb 24, 2025

I do the transformation as the above code:phenotype <- as.numeric(as.character(phenotype)), However, it did not work with the same error:Error in matrix(NA,nrow =nfolds,ncol=numi2):

@zzj2024
Copy link

zzj2024 commented Feb 24, 2025

Here are my codes:

 phenotype
[1] 0 0 0 1 1 1
> names(phenotype) <- group$sample
> phenotype
 C2  C6 C10  T8  T6  T2 
  0   0   0   1   1   1 
> class(phenotype)
[1] "numeric"
> head(data2)
             C2       C6      C10       T8       T6       T2
IFI44L 3.868521 3.895496 3.602317 3.736100 4.412282 4.325066
HOMER2 3.251451 2.544758 3.218017 2.606756 2.402774 2.501470
FMO5   4.016217 3.877928 3.887904 4.181121 4.837627 4.164108
SEMA3G 3.420420 3.548644 3.634122 3.166506 3.925167 3.990411
SBSPON 3.541989 3.262744 3.714089 3.631794 3.841615 3.672471
SMIM33 3.636768 3.232989 2.939847 3.394350 3.782611 1.927010

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

4 participants