How to Make R Package and Upload to Cran
Configuration
Local Repositories
To enable calculation of CRAN metadata, in the Administration module, get toRepositories | Repositories | Local and select CRAN every bit the Package Type when yous create your local repository.
Local Repository Layout
You need tomaintain a specific path structurein order to manage the CRAN packages that are uploaded to CRAN local repositories.
CRAN packages are uploaded to the following locations:
- For example:
/myfirstpkg_1.ii.tg
z.
Artifactory volition detect your packages by performing a holding search causing the folder hierarchy not to have an bear upon on operation.
Placing source packages in the recommended path
When uploading a CRAN bundle via the UI, the default deploy path is non enforced simply is recommended since it allows Artifactory to manage the CRAN packages. Uploading the packages to a different path volition cause the packages not to be identified as CRAN packages.
Remote Repositories
You tin can create CRAN remote repository to proxy and cache remote repositories or other Artifactory instances.
Note that the index files for remote CRAN repositories are stored and renewed according to the Retrieval Cache Period setting.
Virtual Repositories
A Virtual Repository in Artifactory aggregates packages from both local and remote repositories. This allows you to access both locally hosted CRAN packages and remote proxied CRAN libraries from a unmarried URL defined for the virtual repository.
To create a virtual CRAN repository, fixCRAN as thePackage Type,and select the underlying local and remote CRAN repositories to include nether theRepositories department.
Resolving CRAN Packages
Resolving CRAN Packages in the UI
When a CRAN repository is selected in the Artifacts module Tree Browser, click Set Me Up to view the lawmaking snippets you tin can use to publish a CRAN package or to configure your R client to resolve artifacts using the selected .
Resolving CRAN Packages using the R Command Line
one. Run the Set Me Upwards for CRAN.
2. To south
iii. View all the bachelor packages for the selected C
iv. Install a packet from the CRAN repository.
install.packages() - select from a list, on supported clients install.packages("package") - install by package proper name
Deploying CRAN Packages
You lot tin deploy packages to a local or virtual CRAN repository using the or using a Postal service request.
Metadata Updates
The CRAN metadata is automatically calculated and updated when calculation, removing, copying or moving CRAN packages. The adding is only invoked after a packet-related action is completed.
It may sometimes take upwards to thirty seconds to complete equally the procedure is asynchronous and its operation depends on the overall organization load.
You can besides invoke metadata calculation on the entire repository by selecting Reindex Packages.
Setting the Default Deployment Repository
To deploy CRAN packages to a virtual CRAN repository, make sure yous have set up theDefault Deployment Repository.
Deploying a Package Using the UI
Yous can drag and drop, or select a CRAN package to upload in Deploy in the UI. Artifactory volition place if it's a source or binary package.
Artifactory supports two types of packages: binaries and sources. They are treated differently in terms of the deployment in the UI.
Deploying a Source Package
When deploying sources deploy, the Target Path is automatically displayed and we recommend .Changing the src/contrib
path will effect in Artifactory non identifying the package as a CRAN package since Artifactory will not be able to alphabetize it.
Target Path
The Target path is automatically updated and changing information technology could make Artifactory non invoke the metadata calculation, and this bundle to not get indexed.
Deploying a Binary Package
In binary deploy, you lot'll need to fill up the CRAN Antiquity section.
In the CRAN Antiquity section, configure these fields when deploying the CRAN packages. It is mandatory to prepare these fields and are used to create the destinationpath of the deployed binary parcel.
- Distribution: Specifies the operating system.
- R Version: Indicates theR version used.
Target Path
The Target path is updated after the file is deployed and there is no need to change information technology
Deploying a Package Using cURL
ringlet -XPOST "http://localhost:8080/artifactory/api/cran/cran-local/sources" -T package_1.0.tar.gz
curl -XPOST "http://localhost:8080/artifactory/api/cran/cran-local/binaries?distribution=macosx/el-capitan&rVersion=iii.five" -T package_1.0.tgz curl -XPOST "http://localhost:8080/artifactory/api/cran/cran-local/binaries?distribution=windows&rVersion=3.v" -T package_1.0.cypher
When deploying a CRAN binary package, y'all need to specify the distribution and R version as earlier.
When deploying directly (PUT request to a specific path), brand certain the target path is a valid CRAN path:
-
/src/contrib
for sources - /
bin/{distribution}/contrib/{r-version}
for binaries.
Deploying a package to a different path volition not identify the package as CRAN packages, and will not invoke the metadata indexing.
Viewing Individual CRAN Packet Information
Artifactory lets you view selected metadata of a CRAN parcel directly from the UI.
In theArtifact Repository Browser, select your virtual CRAN repository and roll down to notice and select the package you desire to inspect. The metadata is displayed in theCRAN Info tab.
Reindexing a CRAN Repository
You can trigger an asynchronous reindexing of a local CRAN repository either through the UI or using the Balance API.
Through the UI, select your CRAN repository in the Tree Browser and select Recalculate Index from the right-click menu equally shown below (requires Admin privileges)
To reindex a CRAN repository through the REST API, delight refer to Calculate CRAN Repository Metadata .
Source: https://www.jfrog.com/confluence/display/JFROG/CRAN+Repositories
Post a Comment for "How to Make R Package and Upload to Cran"