当我尝试将此代码块编织为HTML时,我一直收到此错误。如果我将eval设置为FALSE,则不会显示我的图。这是错误和代码。为什么RMarkdown要么给我这个错误,要么我不能编织我的情节。我还有另一块效果很好,编织时会显示出来 错误
Quitting from lines 295-326 (RMarkDown_BVR_Model.Rmd)
Error in eval(lhs, parent, parent) :
ReadItem: unknown type 41, perhaps written by later version of R
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> %>% -> eval -> eval
Execution halted
脚本
```{r 2020 v 2019 Orders, echo=FALSE, fig.height=6, fig.width=12, message=FALSE}
step1_cnt_2019bar <- step1_df %>%
group_by(CHANNEL) %>%
filter(DELV_FSCL_YR_WK >= 201901, DELV_FSCL_YR_WK <= 201953) %>%
summarise(Orders = n_distinct(ORD_TRACK_KEY), .groups ='drop', Year = '2019')
step1_cnt_2020bar <- step1_df %>%
group_by(CHANNEL) %>%
filter(DELV_FSCL_YR_WK >= 202001) %>%
summarise(Orders = n_distinct(ORD_TRACK_KEY), .groups ='drop', Year = '2020')
binded_table <- union_all(step1_cnt_2020bar, step1_cnt_2019bar)
plot <- ggplot(binded_table, aes(x = Year, y = Orders, fill = CHANNEL))+
geom_text(aes(label = Orders), vjust = -2.50)+
geom_col(color="grey17", width = 0.25)+
theme_economist()+
xlab("Fiscal Year") +
ylab("Count of Orders") +
scale_fill_manual(values=c("slategray", "cornsilk", "snow4", "sandybrown"))+
theme(plot.title = element_text(size=12), axis.text=element_text(size=10),
axis.title=element_text(size=10), strip.text = element_text(size=10),
axis.title.y = element_text(margin = margin(t = 0, r = 20, b = 0, l = 0)),
axis.title.x = element_text(margin = margin(t = 20, r = 20, b = 0, l = 0)))
plot
```
我正在尝试绘制并编织为HTML的数据
答案 0 :(得分:0)
找到了解决方案:我只是将其保存到一个新的RMarkdown文档中,似乎在修改一些代码时由于某些不匹配或命名错误而导致编织问题