When in swirl, I got the following issue:
Now we'll type the same expression except we'll use the `&&` operator. Type
the expression TRUE && c(TRUE, FALSE, FALSE).
> TRUE && c(TRUE, FALSE, FALSE)
Error in TRUE && c(TRUE, FALSE, FALSE) :
'length = 3' in coercion to 'logical(1)'
Having trouble finding the cause for this problem.
Tried using if() any() and all() but just says that it's not what it is looking for.
The swirl lesson hasn't been updated since the change in R 4.3.0 where '&&' no longer accepts a vector of length > 1. Previously, as indicated in Swirl, the first element of the vector would be assessed, now it returns an error. The same is true for the non-vectorised OR '||'
You can't get passed this question with the lesson as it is written. I have put in a pull request on github for it to be fixed.
In the meantime, you can either directly edit the lesson .yaml file (i.e. find and delete the '&&' and '||' questions), the file is at:
Alternatively you can download the lesson I have editted for the pull request by running these three lines (you may need to start swirl with a different nickname when it asks):