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

Errors in length > 1 #9238

Open
lilyclements opened this issue Nov 6, 2024 · 3 comments
Open

Errors in length > 1 #9238

lilyclements opened this issue Nov 6, 2024 · 3 comments

Comments

@lilyclements
Copy link
Contributor

@rdstern @N-thony @MeSophie @Vitalis95 @derekagorhom We have finally moved to a more recent version of R, but, this means there are some things to flag. In R >=4.2.0 is.na() returns an error not a warning if x has more than one element.

So, the following used to throw a warning that they're only looking at if "A" is NA, but now it throws an error.

if (is.na(c("A", "B"))){
  print("hi")
}

I know of a couple of packages where this has caused problems in the past, but have since been updated to fix this. However, I do not know if our packages are updated to those more recent versions. I also do not know if we will have issues in our code over this.

If anyone sees an error that says the condition has length > 1, then please flag it here so I can go through and check and fix it / suggest the package to update to.

Thanks.

@Patowhiz
Copy link
Contributor

Patowhiz commented Nov 6, 2024

I found one in another R function and made a similar request in comment in issue #9207.

I did a quick code check on the data_object_R6.R file, but didn't found another area that could potentially throw this kind of error. Would be good if someone could exhaustively examine the R base code because of the recent R upgrades.

Tagging @jkmusyoka as well just in case you get such an error during trainings.

@lilyclements
Copy link
Contributor Author

@Patowhiz thanks, I'll look into this now

@lilyclements
Copy link
Contributor Author

@Patowhiz I see you have already fixed it and explained the issue a lot better than I could have! Nice one. Thanks!

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