https://github.com/palantir/palantir-r-sdk
Palantir R SDK
https://github.com/palantir/palantir-r-sdk
octo-correct-managed
Last synced: 4 days ago
JSON representation
Palantir R SDK
- Host: GitHub
- URL: https://github.com/palantir/palantir-r-sdk
- Owner: palantir
- License: apache-2.0
- Created: 2022-03-24T18:53:45.000Z (about 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-19T13:11:10.000Z (7 months ago)
- Last Synced: 2025-03-24T11:45:28.724Z (21 days ago)
- Topics: octo-correct-managed
- Language: R
- Homepage:
- Size: 80.1 KB
- Stars: 13
- Watchers: 222
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: changelog/0.1.0/pr-5.v2.yml
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - palantir/palantir-r-sdk - Palantir R SDK (R)
README
# Palantir R SDK
[](https://opensource.org/license/Apache-2-0/)
[](https://CRAN.R-project.org/package=foundry)
[](https://autorelease.general.dmz.palantir.tech/palantir/palantir-r-sdk)## Setup
Install the library from CRAN:
```R
install.packages("foundry")
```Alternatively, install the latest development version from Github:
```R
install.packages("remotes")
remotes::install_github("https://github.com/palantir/palantir-r-sdk", ref = "0.13.0")
```### Configuration
Configuration for hostname and an authentication token can be provided using options:
* `foundry.hostname` is the hostname of your instance e.g. `example.palantirfoundry.com`
* `foundry.token` is a token acquired from the `Tokens` section of Foundry SettingsAlternatively, you can set the environment variables `FOUNDRY_HOSTNAME` and `FOUNDRY_TOKEN`.
Configuration will be loaded in the following order: options if present, otherwise environment variables.
Authentication tokens serve as a private password and allows a connection to Foundry data. Keep your token secret and do not share it with anyone else. Do not add a token to a source controlled or shared file.#### Extra configuration options
* `foundry.config_dir` is the directory where configuration files are stored, defaults to `~/.foundry`
* `foundry.requests.timeout` is the timeout of HTTPS requests made to Foundry, defaults to 150s### Aliases
To read datasets, aliases must first be registered. Create a YAML file called `~/.foundry/aliases.yml` and define an alias for every dataset you wish to read or write to.
```yaml
my_dataset:
rid: ri.foundry.main.dataset.31388c03-2854-443e-b6cd-fe51c5908371
my_dataset_on_branch:
rid: ri.foundry.main.dataset.5db9d133-6c87-4917-b11e-18b095ac4d30
branch: develop
```## Examples
### Read a tabular Foundry dataset into a data.frame or Apache Arrow Table
```R
library(foundry)
df <- datasets.read_table("my_dataset")
```### Download raw files from a Dataset
```R
all_dataset_files <- datasets.list_files("my_dataset")
downloaded_files <- datasets.download_files("my_dataset", all_dataset_files)
```### Write a data.frame or Apache Arrow Table to Foundry
```R
datasets.write_table(df, "my_dataset")
```### Upload local files or folders to a Dataset
```R
datasets.upload_files(file.path("~", "Downloads", "example"), "my_dataset")
```