title在第1行缺少名称

title在第1行缺少名称

本文介绍了@title在第1行缺少名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行 devtools :: document 时出现此错误,但不知道如何进行故障排除.输入?MyPackage-package 时弹出的已安装软件包中的文件与 MyPackage-package.R 中的文本完全不匹配.最初,我怀疑这可能是由于从 RDpack 中添加了了不起的引文功能,但这不是罪魁祸首.我如何最终解决问题?

I was getting this error when running devtools::document but had no idea how to troubleshoot. The file that popped up on my installed package when I entered ?MyPackage-package did not match the text in MyPackage-package.R at all. I initially suspected it might have been from adding the awesome citation functionality from RDpack, but this was not the culprit. How did I go about ultimately fixing the problem?

推荐答案

该错误是由于我的 PackageName-package.R 文件格式不正确而导致的.

The error resulted from incorrect formatting in my PackageName-package.R file.

我已经大量编辑了 usethis :: use_package_doc()创建的文件,并添加了我所有的roxygen注释下面 usethis添加的默认内容.在查看 merTools 的文档后,我发现拥有材料对于 roxygen2 来说,使.Rd文件在所有其他roxygen注释之后不在之前很重要.

I had heavily edited the file created by usethis::use_package_doc(), and added all of my roxygen comments Below the default content added by usethis. After looking at the documentation for merTools, I saw that it was ok to have the stuff I understand to be important for roxygen2 to make the .Rd files after and not before all the other roxygen comments.

usethis :: use_package_doc()创建的内容(而不只是 NULL 行;它已经在末尾)移动到的底部.R文件,一切似乎都可以正常显示,并且该错误消失了.

After moving the stuff created by usethis::use_package_doc() (and not just the NULL line; that was already at the end) to the bottom of the .R file, everything seemed to render fine and this error disappeared.

这篇关于@title在第1行缺少名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 03:15