我想使用 R studio 在 R 中构建一个包
\n\n当按下时我收到此错误build source package
==> R CMD build CLASS_Projectcompany\n\n* checking for file \'CLASS_Projectcompany/DESCRIPTION\' ... OK\nDuring startup - Warning messages:\n1: Setting LC_CTYPE failed, using "C" \n2: Setting LC_TIME failed, using "C" \n3: Setting LC_MESSAGES failed, using "C" \n4: Setting LC_MONETARY failed, using "C" \n* preparing \'CLASS_Projectcompany\':\n* checking DESCRIPTION meta-information ... ERROR\nMalformed package name\n\nSee section \'The DESCRIPTION file\' in the \'Writing R Extensions\'\nmanual.\nRun Code Online (Sandbox Code Playgroud)\n\n该文件的内容DESCRIPTION是:
Package: CLASS_Projectcompany\nType: Package\nTitle: Class Projectcompany\nVersion: 1.0\nDate: 2015-05-23\nAuthor: Marco Deneenii [aut, cre]\nMaintainer: Marco Deneenii <something@gmail.com>\nDescription: Class Project Company.\nLicense: GPL-2\nRun Code Online (Sandbox Code Playgroud)\n\n你可以帮忙吗?
\n\n_从包条目中删除后,我收到此错误:
==> R CMD INSTALL --build --preclean ClassProjectcompany\n\nDuring startup - Warning messages:\n1: Setting LC_CTYPE failed, using "C" \n2: Setting LC_TIME failed, using "C" \n3: Setting LC_MESSAGES failed, using "C" \n4: Setting LC_MONETARY failed, using "C" \n* installing to library \'/Library/Frameworks/R.framework/Versions/3.2/Resources/library\'\n* installing *source* package \'ClassProjectcompany\' ...\n** R\n** preparing package for lazy loading\nWarning in file(file, "rt") :\n cannot open file \'\xef\xbf\xbd\xef\xbf\xbd.S\xef\xbf\xbd\': No such file or directory\nError in file(file, "rt") : cannot open the connection\nError : unable to load R code in package \'ClassProjectcompany\'\nERROR: lazy loading failed for package \'ClassProjectcompany\'\n* removing \'/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ClassProjectcompany\'\n\nExited with status 1.\nRun Code Online (Sandbox Code Playgroud)\n
它毫不含糊地告诉你
包名格式错误
所以我会从这行开始
Package: CLASS_Projectcompany
Run Code Online (Sandbox Code Playgroud)
并实际检查是否允许使用下划线。他们可能不是。