swirl_courses icon indicating copy to clipboard operation
swirl_courses copied to clipboard

Error in yaml.load for Manipulating Data with dplyr course

Open Mcknick opened this issue 6 years ago • 11 comments

| Attempting to load lesson dependencies...

| Package ‘dplyr’ loaded correctly!

Error in yaml.load(readLines(con), error.label = error.label, ...) : (C:/Users/simck/OneDrive/Documents/R/win-library/3.4/swirl/Courses/Getting_and_Cleaning_Data/Manipulating_Data_with_dplyr/lesson.yaml) Invalid tag for scalar: int#base60

Mcknick avatar Mar 23 '18 04:03 Mcknick

I also encountered similar issue but got a workaround, please see my comment at https://github.com/swirldev/swirl_courses/issues/391

atalv avatar Apr 04 '18 14:04 atalv

The error I encountered in this part of the course is below:

Error in yaml.load(readLines(con, warn = readLines.warn), error.label = error.label, : (C:/Users/user/Documents/R/win-library/4.1/swirl/Courses/Getting_and_Cleaning_Data/Manipulating_Data_with_dplyr/lesson.yaml) Scanner error: while scanning a tag at line 205, column 9 did not find expected whitespace or line break at line 205, column 19

SOLUTION: What I did to solve this is edit the "lesson.yml", as specified in the directory above by opening the file using SUBLIME text editor (maybe okay with other text editor too) and put a # sign (as comment) the line 205 mentioned above.

A-C-A-F avatar Mar 06 '22 12:03 A-C-A-F

Hey all I am very new to R and I have no idea how to "unzip a file" that won't load, and add an # to line 205 in said file. This is the only workaround and it makes no sense to me. Can someone please give a play by as how I get my Swirl course on Data cleaning (dplyr) loaded and ready to go with getting this message:

Error in yaml.load(readLines(con, warn = readLines.warn), error.label = error.label, : (C:/Users/My Name/Documents/R/win-library/4.1/swirl/Courses/Getting_and_Cleaning_Data/Manipulating_Data_with_dplyr/lesson.yaml) Scanner error: while scanning a tag at line 205, column 9 did not find expected whitespace or line break at line 205, column 19

| Leaving swirl now. Type swirl() to resume.

Thank you from the bottom of my heart. None of these work arounds are making any sense to me. I appreciate the help

Rob

rbellamy79 avatar May 29 '22 20:05 rbellamy79

Okay i get that, but I have no way to open lesson.yaml given the fact it is not recognized by anything? it did not load

rbellamy79 avatar May 30 '22 01:05 rbellamy79

@rbellamy79 - Assuming you already downloaded the file from atalv, just right click on lesson.yaml and open with a text editing software (I'm using Windows atm, so I just used Notepad). Then I went to line 205 and added # at the beginning, saved the lesson.yaml file, and then was able to access the swirl lesson. I hope this answers your question.

salhamdani avatar Jun 01 '22 16:06 salhamdani

I have got the same problem, my solution is to add a whitespace so line 205 should look like this: Hint: !is.na (c(3, 5, NA, 10)) will negate the previous command, thus telling us what is NOT NA.

IIIIIan avatar Jul 15 '22 11:07 IIIIIan

I added a "#" just before Hint in the yaml file and it works now. Line 205 starts w/ Hint below. There are online texteditor sites that will give you the line numbers because Mac Textedit won't, I used: https://www.browserling.com/tools/number-lines

  • Class: cmd_question Output: 'Now, put an exclamation point (!) before is.na() to change all of the TRUEs to FALSEs and all of the FALSEs to TRUEs, thus telling us what is NOT NA: !is.na(c(3, 5, NA, 10)).' CorrectAnswer: "!is.na(c(3, 5, NA, 10))" AnswerTests: omnitest('!is.na(c(3, 5, NA, 10))') #Hint: !is.na(c(3, 5, NA, 10)) will negate the previous command, thus telling us what is NOT NA.

jarenmullen avatar Sep 12 '22 22:09 jarenmullen

thanks a lot, for the very few days ago, I have been confused, that rely solve the problem

blessing-art avatar Sep 15 '22 07:09 blessing-art

Hi guys, there might be some problem to this line as it miss the word "Try" as any other line. I have added the word "Try" and it works well now. image

dathuynh168 avatar Nov 06 '22 09:11 dathuynh168

SOLUTION : For Windows users, Go to "C:\Users\User-Name\AppData\Local\R\win-library\4.2\swirl\Courses\Getting_and_Cleaning_Data\Manipulating_Data_with_dplyr" - This will vary for users, But you will get a general idea.

Now install notepad++ from here : Notepad++

Locate the lesson.yml in the above-said folder.

Right-click and open with Notepad++.

Find line 205 and add a # symbol at the beginning of the line as mentioned by @A-C-A-F

image

Save the file.

Go to Rstudio

Start the chapter.

or just add Try in the same line after Try as mentioned by @dathuynh168

image

It works too. Actually, I believe this is the correct way to fix the problem.

P.S.: For Linux users, Piece of cake 😄

ambuvjyn avatar Feb 21 '23 06:02 ambuvjyn