R Packages ERROR

Archive: R Packages ERROR

Use License

https://stackoverflow.com/questions/59303030/devtools-error-in-read-dcfpath-desc-line-starting-this-corresponds-to

1
2
> use_cc0_license("QCF")
Error in read.dcf(con) : 畸形'we proposed a method ...'开头行!

原因:在 DESCRIPTION 文件中,License 字段之上有语段换行后没有在行首加 \t

例如:

错误的格式:

1
2
3
4
Description: adfalkjd adfkj af adf adfadsfadfadfa adfad
adfadfasdzczvlqhlewjv1231 23187 2uodsnf 341-03 dafdf sd
sadfad fadsfa.
License:

正确的格式:

1
2
3
4
Description: adfalkjd adfkj af adf adfadsfadfadfa adfad
adfadfasdzczvlqhlewjv1231 23187 2uodsnf 341-03 dafdf sd
sadfad fadsfa.
License:

Author

1
2
3
4
5
6
7
8
9
10
11
> load_all()
Loading DemoPreTurningPointsCOVID19
Invalid DESCRIPTION:
Authors@R field gives more than one person with maintainer role:
Yanwen Zhang [aut, cre, ths]
Yuanchen Zhu [cre]
Authors@R field gives no person with maintainer role, valid email
address and non-empty name.

See section 'The DESCRIPTION file' in the 'Writing R Extensions'
manual.

这里有两个错误:

  1. 有多个人有 maintainer 程序包维护者的职责;
  2. 具有 maintainer 程序包维护者职责的人没有电子邮箱字段。

显然,这里默认一个程序包只有一个 maintainer,并且与维护者联系的唯一方式是电子邮箱。

因此,选择一人成为 maintainer (cre) 并且为他(她)添加 email 即可。

Roxygen2 Commonts

https://stackoverflow.com/questions/39670646/r-github-package-w-devtools-warning-unknown-macro-item

1
2
3
4
5
6
1: In tools::parse_Rd(path, macros = macros) :
F:/QCFWorkSpace/CurrentProjects/R_Packages_Summer/DemoPreTurningPointsCOVID19/man/Iconicfun.Rd:15: unexpected section header '\value'
2: In tools::parse_Rd(path, macros = macros) :
F:/QCFWorkSpace/CurrentProjects/R_Packages_Summer/DemoPreTurningPointsCOVID19/man/Iconicfun.Rd:26: unexpected section header '\description'
3: In tools::parse_Rd(path, macros = macros) :
F:/QCFWorkSpace/CurrentProjects/R_Packages_Summer/DemoPreTurningPointsCOVID19/man/Iconicfun.Rd:29: unexpected END_OF_INPUT '

从错误信息可以看出,对于 roxygen2 注释的解析出了问题。其原因在于,注释中出现了中文字符或者其他引发歧义的字符。