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

Swirl "Logic" course has an error in one lesson not allowing you to finish said question #911

Open
StrikerG1 opened this issue Jul 19, 2023 · 6 comments

Comments

@StrikerG1
Copy link

The question:
Now we'll type the same expression except we'll use the && operator. Type the expression TRUE && c(TRUE, FALSE, FALSE).

This expression raises an error in R, so you can't get the question to be correct. When you do skip(), Swirl runs the snippet of code for you, erroring out of Swirl. This makes it so you cannot complete the 'Logic' section of the swirl course in R
image

@JoshuaGMathews
Copy link

I'm having this same issue. When I use ?"&&" it says this on the help page:
"Using vectors of more than one element in && or || will give an error."

Not sure how other people have been getting past this.

@isotope493
Copy link

isotope493 commented Jul 24, 2023

I am having the same issue in RStudio 2023.060.1 Build 524 | R 4.3.1. Additionally, the "skip()" function does not work as it is supposed to skip a question - not the whole lesson.

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

| When you are at the R prompt (>):
| -- Typing skip() allows you to skip the current question.
| -- Typing play() lets you experiment with R on your own; swirl will ignore what you do...
| -- UNTIL you type nxt() which will regain swirl's attention.
| -- Typing bye() causes swirl to exit. Your progress will be saved.
| -- Typing main() returns you to swirl's main menu.
| -- Typing info() displays these options again.

> skip()
Error in TRUE && c(TRUE, FALSE, FALSE) : 
  'length = 3' in coercion to 'logical(1)'
| Leaving swirl now. Type swirl() to resume.

@StrikerG1
Copy link
Author

Yeah. The error is caused when swirl tries to run the command it was expecting, giving swirl itself an error rather than just one in the console

I am having the same issue in RStudio 2023.060.1 Build 524 | R 4.3.1. Additionally, the "skip()" function does not work as it is supposed to skip a question - not the whole lesson.

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

| When you are at the R prompt (>):
| -- Typing skip() allows you to skip the current question.
| -- Typing play() lets you experiment with R on your own; swirl will ignore what you do...
| -- UNTIL you type nxt() which will regain swirl's attention.
| -- Typing bye() causes swirl to exit. Your progress will be saved.
| -- Typing main() returns you to swirl's main menu.
| -- Typing info() displays these options again.

> skip()
Error in TRUE && c(TRUE, FALSE, FALSE) : 
  'length = 3' in coercion to 'logical(1)'
| Leaving swirl now. Type swirl() to resume.

@csecarroll
Copy link

I'm also having the same issue.

I wasn't about to finish the lesson.

image

@daniel-j-miller
Copy link

I have put in a pull request to update the https://github.com/swirldev/swirl_courses/pull/527

Until this is merged you can either edit out the uestions in the .yaml file or copy my editted lesson. Learners may need to use a different name when loading swirl if they have already tried the lesson:

create file path to swirl lesson file

file_path <- file.path(find.package("swirl"),"Courses","R_Programming","Logic","lesson.yaml")

url of my edited lesson file

file_url <- "https://raw.githubusercontent.com/daniel-j-miller/swirl_courses/master/R_Programming/Logic/lesson.yaml"

download and save file

download.file(file_url, file_path)

@DustyFootPhilosopher
Copy link

I went down the rabbit hole and found that the error is because the newer version of R limits the && function result length to 1, whereas I guess previously it did not. There are tickets in to resolve it.

But there is a second issue with skip():

skip() is defined three different ways depending on the method used :

  1. Rstudio cursor highlight -skip(): 'skip the current unit of instruction.'
  2. ?skip()-skip():'return to main menu'
  3. info() printed menu-skip():'allows you to skip the current question'

| When you are at the R prompt (>):
| -- Typing skip() allows you to skip the current question.
| -- Typing play() lets you experiment with R on your own; swirl will ignore what
| you do...
| -- UNTIL you type nxt() which will regain swirl's attention.
| -- Typing bye() causes swirl to exit. Your progress will be saved.
| -- Typing main() returns you to swirl's main menu.
| -- Typing info() displays these options again.

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

6 participants