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 TRUE && C(TRUE, FALSE, FALSE) : 'length - 3' in coercion to 'logical(1)' #916

Open
CharPatton opened this issue Sep 2, 2023 · 2 comments

Comments

@CharPatton
Copy link

Awesome program; thanks to all.

However, I've run into my first bug at 8: Logic @ 42%. Typing in the requested phrase leads to an error and getting kicked out of swirl.


I Now we'll type the same expression except we'll use the '&&' operator. Type the expression TRUE && C(TRUE, FALSE, FALSE).

skip()
Error in TRUE && C(TRUE, FALSE, FALSE) :
'length - 3' in coercion to 'logical(1)'
I Leaving swirl now. Type swirl) to resume.


It took me a while how to break out of this trap (I'm computer unsavvy), but I have but would like to do the module from 42% to the end.

Any help would be greatly appreciated. Thanks!

@maiermac
Copy link

maiermac commented Apr 2, 2024

same problem here. Wanted to use SWIRL as part of a Coursera course which I can't complete for the "Logic" part as the functionality runs in that error

@rabbyiv
Copy link

rabbyiv commented Aug 21, 2024

I've just come across this problem and would love to continue learning but I'm so stuck and don't know how to get past this loop of despair...

I found this on stackoverflow...

Difference between Boolean operators && and &

"The shorter ones (&) are vectorized... The longer form is not, and so (as of 4.3.0) must be given inputs of length 1."

This now makes sense as to the error I'm receiving. Any versions past 4.3.0 just won't work.

It's not a huge problem, but I can't finish that lesson sadly and will move on and hopefully someone will be able to fix it?

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

3 participants