繁体   English   中英

为什么我不能在 rmarkdown 中编织?

[英]Why can't I knit in rmarkdown?

我已经在 R 脚本中成功编写了我的代码,但是当我尝试在 Rmarkdown 中编织时,出现以下错误。 "

在此处输入图像描述

我努力了:

  1. 将包安装到 Rmarkdown
  2. 使用不同的环境(R studio cloud 和桌面 R)得到完全相同的结果。 我认为这意味着我的代码有问题,但只有当我尝试编织时。 如果我在 rmarkdown 中运行代码,一切正常。 但我不能编织到 html。

下面是我的脚本代码:

View(Daily_log_weight)

myweight <- Daily_log_weight%>%
  clean_names

View(myweight)

#Example: ggplot(data=heartrate_seconds_clean) + geom_bar(mapping=aes(y=value), color='purple')

#Lesson learned: Only things pertaining to an function should go into that function. Geom_point,  labs, etc.

chart1 <- ggplot(data=myweight) + geom_point(mapping=aes(x=day,y=morning_weight), color='orange') + labs(x="The Day", y="My Morning Weight", title = "My Awesome Weightloss Journey", subtitle = "By Naomi Narcisse")

chart1


chart2 <- ggplot(data=myweight) + geom_smooth(mapping=aes(x=day,y=after_workout_weight), color='turquoise') + labs(x="The Day", y="After Workout Weight", title = "Continued.. . After workout", subtitle = "By Naomi Narcisse")

chart2


chart3 <- ggplot(data=myweight) + geom_jitter(mapping=aes(x=morning_weight,y=after_workout_weight), color='dark green', fill='light pink') + labs(x="My Morning Weight", y="My After-Workout Weight", title = "Comparison Weightloss", subtitle = "By Naomi Narcisse")

chart3

如果一切都失败了,请重新安装 R、RStudio 和所有软件包。 Windows 用户也应安装 Rtools,它将处理 package 安装。

暂无
暂无

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

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