1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-25 04:35:48 +00:00
gitea/docs/content/usage/packages/cran.zh-cn.md
John Olheiser bd4c7ce578
Docusaurus-ify (#26051)
This PR cleans up the docs in a way to make them simpler to ingest by
our [docs repo](https://gitea.com/gitea/gitea-docusaurus).

1. It includes all of the sed invocations our ingestion did, removing
the need to do it at build time.
2. It replaces the shortcode variable replacement method with
`@variable@` style, simply for easier sed invocations when required.
3. It removes unused files and moves the docs up a level as cleanup.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-07-26 04:53:13 +00:00

2.2 KiB
Raw Blame History

date title slug draft toc menu
2023-01-01T00:00:00+00:00 CRAN 软件包注册表 cran false false
sidebar
parent name sidebar_position identifier
packages CRAN 35 cran

CRAN 软件包注册表

R 软件包发布到您的用户或组织的类似 CRAN 的注册表。

要求

要使用CRAN软件包注册表您需要安装 R

配置软件包注册表

要注册软件包注册表,您需要将其添加到 Rprofile.site 文件中,可以是系统级别、用户级别 ~/.Rprofile 或项目级别:

options("repos" = c(getOption("repos"), c(gitea="https://gitea.example.com/api/packages/{owner}/cran")))
参数 描述
owner 软件包的所有者

如果需要提供凭据可以将它们嵌入到URL(https://user:password@gitea.example.com/...)中。

发布软件包

要发布 R 软件包,请执行带有软件包内容的 HTTP PUT 操作。

源代码软件包:

PUT https://gitea.example.com/api/packages/{owner}/cran/src
参数 描述
owner 软件包的所有者

二进制软件包:

PUT https://gitea.example.com/api/packages/{owner}/cran/bin?platform={platform}&rversion={rversion}
参数 描述
owner 软件包的所有者
platform 平台的名称
rversion 二进制的R版本

例如:

curl --user your_username:your_password_or_token \
     --upload-file path/to/package.zip \
     https://gitea.example.com/api/packages/testuser/cran/bin?platform=windows&rversion=4.2

如果同名和版本的软件包已存在,则无法发布软件包。您必须首先删除现有的软件包。

安装软件包

要从软件包注册表中安装R软件包请执行以下命令

install.packages("{package_name}")
参数 描述
package_name The package name.

例如:

install.packages("testpackage")