Search code examples
kaggle

Error in parse(text = x, srcfile = src): <text>:13:6: unexpected symbol 12: 13: This R ^


I am trying to create and run a simple .Rmd (RMarkdown file) on Kaggle.

When I create a new RMarkdown on Kaggle, when I click 'Run All' to run the Rmd code, I see:


Your Kernel is now running in the cloud.
Enter some code at the bottom of this console and press [Enter].
Session is starting...
Session started.
ERROR
Error in parse(text = x, srcfile = src): <text>:13:6: unexpected symbol 12: 13: This R ^

How can I successfully run a sample RMarkdown on Kaggle?

Notes

  • Similar problem outlined 10 days ago here.

    • The comment isn't helpful (it's just a shortcut instead of pressing the 'Run All' button)
  • Problem also seems to be mentioned 2 days ago here

Reproducible example

When creating a new RMarkdown on Kaggle, I do the following.

From the kaggle.com homepage, click on 'Code' on the left hand side, then on 'New Notebook':

enter image description here

When I do this, it is immediately clear that the interpreter doesn't lint the code correctly (look at the colours):

enter image description here

For reference, the language is 'RMarkdown':

enter image description here

And the editor type is 'Script':

enter image description here

And when I click 'Run All':

enter image description here


Solution

  • Click 'Save Version' (top right of screen)

    That will run (i.e. 'knit') your RMarkdown code (it may take a moment). A link to the knitted document pop up in the bottom left of screen. It's that easy!

    enter image description here