Home > Software design >  RMarkdown error when running in Kaggle - runs OK locally
RMarkdown error when running in Kaggle - runs OK locally

Time:02-22


I am a newbie in both R and Kaggle. I am running successfully my RMarkdown in RStudio on my local system.
I uploaded my dataset and import the RMarkdwon to Kaggle.
It fails quite early (after packages installation) when trying to perform the following code:
{r, echo=TRUE, message=FALSE, warning=FALSE}

# Create year ride observation frame
####################################
# Load rides data from the bicycle trips CSV files 
# All file from CSV sub-directory are loaded and their full path stored in a list
all_rides <- list.files(path = "../input/cyclistic-dataset/CSV/Ride Data/", pattern = "*tripdata/*divvy-tripdata.csv", full.names = TRUE) %>%  
  # repeatedly apply read_csv to all files
  lapply(read_csv) %>% 
  # Combine data sets into one data set 
  bind_rows  
                                                     
# Let's take a look at few rows of data, set size and column headers
glimpse(all_rides)

I am getting the following error:

    Log Message
    3.0s    1   (*) NOTE: I saw chunk options " echo=TRUE, messa../input/cyclistic-dataset/CSV/Ride Data/ning=FALSE"
    3.0s    2   please go to https://yihui.org/knitr/options
    3.0s    3   (it is likely that you forgot to quote "character" options)
    3.0s    4   Error in parse(text = code, keep.source = FALSE) :
    3.0s    5   :1:60: unexpected symbol
    3.0s    6   1: alist( echo=TRUE, messa../input/cyclistic-dataset/CSV/Ride Data
    3.0s    7   ^
    3.0s    8   Calls: render ... parse_params -> withCallingHandlers -> eval -> parse_only -> parse
    3.0s    9   Execution halted 

Any idea please?

Thanks!

CodePudding user response:

I see the issue though I do not know why it has happened. I had to edit the RMarkdown, so when I edit after every character it display a popup message: "Code Editor out of Sync" ... I click OK not knowing what else to do and apparently some of the characters in the update weren't save and I got "nonsense". I only saw that when I click on the <> on the left vertical panel. Any idea how am I suppose to update the RMarkdown in the Kaggle notebook? Thanks!

CodePudding user response:

Perhaps this article will help - https://www.kaggle.com/datasniffer/how-to-make-rmarkdown-work-in-kaggle

  • Related