Movatterモバイル変換


[0]ホーム

URL:


Project Status: Active – The project has reached a stable, usable state and is being actively developed.CITestscran version

rt

An interface to theRequestTrackerAPI.

Installation

install.packages("rt")

Usage

Setup

To start using thert package, log in to your RTinstance by setting the server URL in usingSys.setenv andusert_login() to log in and store your sessionlocally.

Below, we log into Best Practical’s demo installation of RT:

library(rt)Sys.setenv("RT_BASE_URL"="https://demo.bestpractical.com")rt_login()# Enter demo/demo

Once you are successfully logged in, you’re all set to use thepackage. Thert package supports all of theRequestTracker RESTAPI:

Note: Most of these functions support being chained together (forexample, with the%>%).

See the included vignettes for more information about usage.

Logging out

To log out, use thert_logout function (or restart yourR session):

rt_logout()

Development & Testing

A test suite is provided that is comprised mostly of integrationtests that are configured to run against a local installation of RT. Bydefault, runningdevtools::test() will only run a smallsubset of the full test suite: those that do not depend on being able tocall out to an RT installation (i.e., unit tests).

To run the full test suite locally,

  1. Start a local RT installation withDocker:

    docker run-d--name rt-p 80:80 netsandbox/request-tracker
  2. Turn on integration tests for your session

    Sys.setenv("RT_INTEGRATION"=TRUE)
  3. Rundevtools::test() from the same session as(2)

rt_api objects

All API calls go through an intermediate state as anrt_api object, which is made up of three parts:

  1. thecontent, generally returned as a tibble/dataframe
  2. thepath or URL that was accessed
  3. the HTTPresponse from the API.

This is mainly to help normalize out some of the inconsistencies inthe RT API itself and make implementing the API call wrapperseasier.

Support / Issues / Feedback

Let us know aboutany issues or bugs.

Acknowledgements

Support was provided by the National Center for Ecological Analysisand Synthesis, a Center funded by the University of California, SantaBarbara, and the State of California.

nceas_footer


[8]ページ先頭

©2009-2025 Movatter.jp