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

Fix Issue #2667 #85

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Fix Issue #2667 #85

merged 1 commit into from
Jul 3, 2024

Conversation

JTPetter
Copy link
Collaborator

@JTPetter JTPetter commented Jul 3, 2024

@JTPetter JTPetter requested a review from koenderks July 3, 2024 14:50
@koenderks
Copy link
Contributor

koenderks commented Jul 3, 2024

What does this fix?

Edit: sorry didn't see. Did you test this? I'm at a conference without laptop so can't test but will happily approve if you did.

@JTPetter
Copy link
Collaborator Author

JTPetter commented Jul 3, 2024

Yes, I tested it! Thank you

@koenderks
Copy link
Contributor

Hmm interesting, can you explain this fix to me? Doesn't !identical(samples, "") also have length > 1? Sorry if this is a weird question but I don't have my laptop and am curious :p

@JTPetter
Copy link
Collaborator Author

JTPetter commented Jul 3, 2024

Of course! "==" (or "!=") compares elements of an object element wise, so for instance entries in a vector one by one (but also matrices, dataframes etc.). So if your vector has length n it will return a boolean vector with length n. If you pass a boolean vector with length > 1 to a control statement in R, it will crash. I think this changed with R4.0, previously it would simply evaluate the first element of the boolean vector.

The identical function does a "deep" comparison, so it also checks whether the data type is the same. So the evaluated object will either be exactly an empty string or it returns FALSE. So the evaluation result is always a single boolean.

@JTPetter JTPetter merged commit 0d3f9f8 into jasp-stats:master Jul 3, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants