首页 > 解决方案 > 在 Rstudio 中编织时 Rcpp 代码抛出错误

问题描述

我正在尝试运行以下 rmarkdown 代码:

https://docs.google.com/document/d/164VZx3_cZ4tBa1Um39VH1cQ4zqRuCvpCTj-B50Vq2gk/edit?usp=sharing

但是当我编写代码时出现以下错误:

Quitting from lines 26-47 (demo.Rmd) 
Error in (function (file = "", code = NULL, env = globalenv(), embeddedR = TRUE,  : 
Error 1 occurred building shared library.
Calls: <Anonymous> ... block_exec -> in_dir -> engine -> do.call -> <Anonymous>
In addition: Warning message:
No function return type found for Rcpp::export attribute at file1af863722d6.cpp:4 
Execution halted `

当我用 {rcpp} 替换 {Rcpp} 时,我可以运行它,但它没有给出输出。如何让它运行并提供输出?

标签: rr-markdownknitr

解决方案


推荐阅读