Help in swirl lesson 8 logic TRUE && c (TRUE, FALSE, FALSE ) Error in TRUE && c(TRUE, FALSE, FALSE) : 'length = 3' in coercion to 'logical(1)

TRUE && c (TRUE, FALSE, FALSE )
Error in TRUE && c(TRUE, FALSE, FALSE) :
'length = 3' in coercion to 'logical(1)

I'm getting this error anytime I try to work on the posit cloud swirl course lesson 8 on logic

It seems to be a system glitch, is there anyway to go around because I can't get to the next lesson

run

?`&&`

in R console and the help page will give you the answer:

& and && indicate logical AND and | and || indicate logical OR. The shorter forms performs elementwise comparisons in much the same way as arithmetic operators. The longer forms evaluates left to right, proceeding only until the result is determined. The longer form is appropriate for programming control-flow and typically preferred in if clauses.

Using vectors of more than one element in && or || will give an error.

1 Like

Thanks for this response. After running the ?'&&', I see that using && would report as an error, but how do I go past the particular step in the course. I'm required to replicate a particular string and any deviation means the course wouldn't accept it, rather it would asking me to type the exact code, meanwhile the exact code is an error. This is my dilemma, any further help?

Thanks

it's a back quote `, not a quotation ', please note the difference.

Still the same thing, I think I'll just skip the topic for now