Home > Blockchain >  No such file or directory Knit R markdown
No such file or directory Knit R markdown

Time:04-18

I am attempting to knit a markdown that I have been working on for Google Data Analytics Professional Certificate Capstone. I have the markdown near completed and would like to see how it delivers, however, when I attempt to knit I receive "no such file or directory" error. This was not occurring for me while working on the markdown as I was simultaneously using the knit function to the view the work. It happened when I changed the output from html_notebook to word_document. I changed it back to html_notebook and am still receiving the same error. I have provided a caption of the error message. I understand it has something to do with the directory however I have the .RMD located in the same folder as the imported data sets which I create the data frame from. I am running that code using a data frame that is in my environment so why would markdown not be able to find this data? Any help would be appreciated! Also, when I take out new_sleep_averages code it then returns the same error on my next visualization with a different data frame.

enter image description here

CodePudding user response:

the issue is because

new_sleep_averages is not found. perhaps you renamed the variable name or the name does not exist.

Check Line 51, and trace where new_sleep_averages is created

CodePudding user response:

I have found the answer via another stack overflow question. Here is the link Can't resolve error in .Rmd file <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval ->

I installed this line of code at the top of my document and everything ran fine.

knitr::opts_chunk$set(error = TRUE)

-- This however did not load graphs there were still errors in the code which were solved by inputting the individual code chunks for each graph within the markdown. For example I only had

user6_hr_April12 %>%
  mutate(user6_hr_April12, Time = as.POSIXct(Time, format = "%m/%d/%Y %I:%M:%OS %p")) %>%
  ggplot(aes(x = Time, y = Value))  
  geom_line()  
  theme_bw()  
  scale_x_datetime(breaks = "1 hour", date_labels = "%I:%M %p")  
  theme(axis.text.x = element_text(angle = 45))  
  ggtitle("heart rate user_6",
          subtitle = "4-12-2016")

but had to input the code for read.csv and all the cleaning I did as well.

  • Related