forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
* upstream/main: Fix users cannot visit issue attachment bug (go-gitea#25019) Fix incorrect issuel filter menu style (go-gitea#25018) Update repo's default branch when adding new files in an empty one (go-gitea#25017) Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (go-gitea#24988) Merge `new project` templates into one (go-gitea#24985) Add chinese documentations for `cran package registry` (go-gitea#25012)
- Loading branch information
Showing
23 changed files
with
222 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ cpu.out | |
|
||
*.db | ||
*.log | ||
*.log.*.gz | ||
|
||
/gitea | ||
/gitea-vet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
date: "2023-01-01T00:00:00+00:00" | ||
title: "CRAN 软件包注册表" | ||
slug: "cran" | ||
draft: false | ||
toc: false | ||
menu: | ||
sidebar: | ||
parent: "packages" | ||
name: "CRAN" | ||
weight: 35 | ||
identifier: "cran" | ||
--- | ||
|
||
# CRAN 软件包注册表 | ||
|
||
将 [R](https://www.r-project.org/) 软件包发布到您的用户或组织的类似 [CRAN](https://cran.r-project.org/) 的注册表。 | ||
|
||
**目录** | ||
|
||
{{< toc >}} | ||
|
||
## 要求 | ||
|
||
要使用CRAN软件包注册表,您需要安装 [R](https://cran.r-project.org/)。 | ||
|
||
## 配置软件包注册表 | ||
|
||
要注册软件包注册表,您需要将其添加到 `Rprofile.site` 文件中,可以是系统级别、用户级别 `~/.Rprofile` 或项目级别: | ||
|
||
``` | ||
options("repos" = c(getOption("repos"), c(gitea="https://gitea.example.com/api/packages/{owner}/cran"))) | ||
``` | ||
|
||
| 参数 | 描述 | | ||
| ------- | -------------- | | ||
| `owner` | 软件包的所有者 | | ||
|
||
如果需要提供凭据,可以将它们嵌入到URL(`https://user:[email protected]/...`)中。 | ||
|
||
## 发布软件包 | ||
|
||
要发布 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版本 | | ||
|
||
例如: | ||
|
||
```shell | ||
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软件包,请执行以下命令: | ||
|
||
```shell | ||
install.packages("{package_name}") | ||
``` | ||
|
||
| 参数 | 描述 | | ||
| -------------- | ----------------- | | ||
| `package_name` | The package name. | | ||
|
||
例如: | ||
|
||
```shell | ||
install.packages("testpackage") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.