r - 使 R 包在 Windows 和 Linux 中工作

标签 r package

我用R写了一个非常基础的包,其实我是跟着this tutorial用于创建基本包。

我的软件包在 linux 中运行良好。例如:

> install.packages("linmod", repos=NULL)
install.packages("linmod", repos = NULL) 中的警告:
缺少参数“lib”:使用“/home/jpgoel/R/i486-pc-linux-gnu-library/2.9”
* 安装 *source* 包 ‘linmod’ ...
** R
** 数据
** 为延迟加载准备包
** 帮助
*** 安装帮助索引
>>> 构建/更新包“linmod”的帮助页面
格式:文本 html latex 示例
** 构建包索引...
*完成(linmod)
> 图书馆(linmod)
> 数据(mod1)
> 模组1
称呼:
linmod.default(x = x, y = y)

系数:
恒定重量
-0.3566624 4.0340627

现在,我将我的“linmod”文件夹复制到 Windows XP,并尝试了以下操作:

> install.packages("C:\\Documents\and\Settings\\foo\\Desktop\\linmod",repos=NULL)
gzfile(file, "r") 中的错误:无法打开连接
此外: 警告消息:
1:在解压缩(zipname,exdir = dest)中:从zip文件中提取错误1
2:在 gzfile(file, "r") 中:
无法打开压缩文件“linmod/DESCRIPTION”,可能的原因“没有这样的文件或目录”
>

好的。然后我把那个文件夹放到一个 .zip 文件中。然后我转到 Packages -> Install package(s) from local zip files...并选择我的包。

> utils:::menuInstallLocal()
更新 HTML 包描述

> 图书馆(linmod)
库中的错误(linmod):“linmod”不是有效的已安装包

我难住了。我的包没有任何 native 代码(例如,没有用 C 编写的扩展。)

请随意下载 .zip from here (下载链接一直在底部,“将文件保存到您的电脑”)

最佳答案

考虑使用优秀的 CRAN Win-Builder服务将您的 R 包源转换为 Windows 的可安装 zip 文件。

您只需通过 ftp 上传,然后很快就会收到有关您的包裹的通知。

关于r - 使 R 包在 Windows 和 Linux 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1685181/

相关文章:

r - 如何保护 R 中的矩阵不被 Rcpp 更改?

r - 如何从嵌套列中的列表中提取多个组件到列中

r - 如何解决Mcode的 “model build step failed”错误(在 “mrgsolve”软件包下)?警告消息 “'表示“未找到”是什么意思?

戈朗 : cannot install package zvelo/ttlru

python - Zappa 初始化 -- Flask UnicodeDecodeError : 'charmap' codec can't decode byte 0x81 in position 301: character maps to <undefined>

r - ggplot 中虚拟变量的分位数回归误差

r - R中具有相同数据的相同操作的不可预测的内存使用情况

r - 如何删除多余的 | (管道)加载时与行的分隔符 |将(管道)分隔的文本放入 R 中

Java ClassCastException 具有不同包中的两个相同的类,通过网络发送

go - 如何解决 "use of package without a selector error"