swirldev / swirl

:cyclone: Learn R, in R.
http://swirlstats.com
Other
1.14k stars 599 forks source link

Error in TRUE && C(TRUE, FALSE, FALSE) : 'length - 3' in coercion to 'logical(1)' #916

Open CharPatton opened 1 year ago

CharPatton commented 1 year ago

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 commented 7 months ago

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 commented 3 months ago

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?