Jfortin1 / neuroCombat_Rpackage

neuroCombat R package
20 stars 8 forks source link

Error in if (ns > 0) { : missing value where TRUE/FALSE needed #1

Closed afm1989 closed 2 years ago

afm1989 commented 3 years ago

getting this error when trying to run combat in R...I have a data matrix, a batch specifying different sites, and a matrix with biological variables. I've removed all rows that have all NAs. What's causing this?

Jfortin1 commented 3 years ago

Could you add the results of

ns <- rowSums(is.na(dat))
print(ns)

here?

afm1989 commented 3 years ago

Sure, it was too many entries so I saved it to a dataframe called "test" and when I view that, it looks like this (column V1 has 5s all the way down):

[image: Screen Shot 2021-06-08 at 7.31.56 PM.png]

On Tue, Jun 8, 2021 at 7:18 PM Jean-Philippe Fortin < @.***> wrote:

Could you add the results of

ns <- rowSums(is.na(dat)) print(ns)

here?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Jfortin1/neuroCombat_Rpackage/issues/1#issuecomment-857253562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUM75HPMNDCUIC5I4KXXLZTTR2QODANCNFSM46K26LKQ .

Jfortin1 commented 3 years ago

Could you show the output of the following:

ns <- rowSums(is.na(dat))
print(sum(ns==ncol(data)))
afm1989 commented 3 years ago

Output is:

[1] 145

On Tue, Jun 8, 2021 at 7:40 PM Jean-Philippe Fortin < @.***> wrote:

Could you show the output of the following:

ns <- rowSums(is.na(dat)) print(sum(ns==ncol(data)))

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Jfortin1/neuroCombat_Rpackage/issues/1#issuecomment-857262724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUM75HJPGFBPOEGCWW5DQZLTR2S6JANCNFSM46K26LKQ .

afm1989 commented 3 years ago

Hi,

Just wanted to follow up on this - any idea what's causing the error?

Thanks!! Alex

On Tue, Jun 8, 2021 at 7:56 PM Alexandra Muratore @.***> wrote:

Output is:

[1] 145

On Tue, Jun 8, 2021 at 7:40 PM Jean-Philippe Fortin < @.***> wrote:

Could you show the output of the following:

ns <- rowSums(is.na(dat)) print(sum(ns==ncol(data)))

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Jfortin1/neuroCombat_Rpackage/issues/1#issuecomment-857262724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUM75HJPGFBPOEGCWW5DQZLTR2S6JANCNFSM46K26LKQ .

AlexHatoum commented 2 years ago

Hello,

I am having the same issue, and I have no missing data in my file.

A.S.H.

Jfortin1 commented 2 years ago

@AlexHatoum What is the output of

ns <- rowSums(!is.finite(dat))
print(sum(ns==ncol(dat)))
afm1989 commented 2 years ago

It turned out that for me this was an error with the version of R I was using. I forget exactly which line ran into the error, but when I used an older version of R it ran correctly. I’ll see if I can find and post some more information about where the error originates.

On Mar 17, 2022, at 7:30 PM, Jean-Philippe Fortin @.***> wrote:

 @AlexHatoum What is the output of

ns <- rowSums(!is.finite(dat)) print(sum(ns==ncol(dat))) — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.