简体   繁体   English

没有这样的文件或目录编织 R markdown

[英]No such file or directory Knit R markdown

I am attempting to knit a markdown that I have been working on for Google Data Analytics Professional Certificate Capstone.我正在尝试编织一个 markdown,我一直在为 Google 数据分析专业证书顶点工作。 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.我已经完成了 markdown,想看看它是如何交付的,但是,当我尝试编织时,我收到“没有这样的文件或目录”错误。 This was not occurring for me while working on the markdown as I was simultaneously using the knit function to the view the work.我在 markdown 上工作时并没有发生这种情况,因为我同时使用针织 function 来查看作品。 It happened when I changed the output from html_notebook to word_document.它发生在我将 output 从 html_notebook 更改为 word_document 时。 I changed it back to html_notebook and am still receiving the same error.我将其改回 html_notebook,但仍然收到相同的错误。 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.我知道它与目录有关,但是我将 .RMD 与我从中创建数据框的导入数据集位于同一文件夹中。 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?我正在使用我环境中的数据框运行该代码,那么为什么 markdown 无法找到该数据? 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.当我取出 new_sleep_averages 代码时,它会在我的下一个可视化中使用不同的数据框返回相同的错误。

在此处输入图像描述

the issue is because问题是因为

new_sleep_averages is not found.未找到new_sleep_averages perhaps you renamed the variable name or the name does not exist.也许您重命名了变量名称或名称不存在。

Check Line 51, and trace where new_sleep_averages is created检查第 51 行,并跟踪创建new_sleep_averages的位置

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 ->这是链接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 -- 然而,这并没有加载图表,代码中仍然存在错误,这些错误通过在 markdown 中为每个图表输入单独的代码块来解决。例如,我只有

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.但必须输入 read.csv 的代码以及我所做的所有清理工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM