Learn R Programming

dwapi

The dwapi R package makes it easy to use data.world's REST API in R.
Using the package, users can:

  • Create and update datasets, metadata and files
  • Query datasets using SQL and SPARQL
  • Download files and entire datasets

Getting Started

To get started, load the library and checkout the quickstart vignette.

library(dwapi)
vignette("quickstart", package = "dwapi")

Here is a simple example:

intro_dataset <- dwapi::get_dataset(
  dataset = "https://data.world/jonloyens/an-intro-to-dataworld-dataset")

Notice that dataset is parameter required by most functions and can be provided in two formats:

  1. URL: "https://data.world/jonloyens/an-intro-to-dataworld-dataset"
  2. Path: "jonloyens/an-intro-to-dataworld-dataset"

Installation

To get the current released version from CRAN:

install.packages("dwapi")

To get the current development version from GitHub:

devtools::install_github("datadotworld/dwapi-r", build_vignettes = TRUE)

Configuration

First, users must obtain an API authentication token at: https://data.world/settings/advanced

IMPORTANT: For your security, do not include your API authentication token in code that is intended to be shared with others.

To configure the package, use dwapi::configure:

> library(dwapi)
> dwapi::configure(auth_token = "YOUR_TOKEN_GOES_HERE")

Next

Check out the quickstart vignette and the package documentation (?dwapi).

> vignette("quickstart", package = "dwapi")
> ?dwapi

Copy Link

Version

Install

install.packages('dwapi')

Monthly Downloads

6

Version

0.1.3.1

License

Apache License 2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Rafael Pereira

Last Published

August 19th, 2018

Functions in dwapi (0.1.3.1)

create_dataset_response

De-serialize a structured list into create_dataset_reponse object.
dataset_update_request

Create request object for updating existing datasets.
auth_token

Return the currently configured API authentication token
delete_dataset

Delete a dataset
get_insight_optional_fields

Get the insight optional fields
get_insight_required_fields

Get the insight required fields
get_table_schema

Retrieve schema information for a dataset table.
check_file_summary_response

Validate get_dataset response files.
configure

Library configuration tool.
add_files_by_source

Add one or more files to a dataset.
create_dataset

Create a new dataset.
append_data_frame_to_stream

Append an R data frame to a data.world stream.
download_datapackage

Download data package.
get_user

Retrieve user information for the currently authenticated user.
check_project_summary_response

Validate get_project response object.
download_file

Download file from dataset onto the local file system.
file_create_request

Create object for adding a dataset file.
check_user_info_response

Validate get_user response object, returning the object if valid, and stopping with an error message if invalid.
dataset_replace_request

Create request object for replacing existing datasets.
linked_dataset_create_or_update_request

Create request object for new linked datasets, or updates to existing datasets.
add_file

Add a file to a request object.
list_tables

List tables in a dataset.
file_source_create_or_update_request

Create object for adding/updating dataset file sources.
download_file_as_data_frame

Download dataset file onto a data frame.
file_summary_response

Deserialize get_dataset response files.
delete_insight

Delete an insight.
dataset_summary_response

Deserialize get_dataset response object.
add_file_by_source

Add a single file to a dataset.
create_insight_response

De-serialize a structured list into create_insight_response object.
delete_project

Delete a project.
download_table_as_data_frame

Download a dataset table onto a data frame.
dwapi

dwapi: A client for data.world's REST API.
sdk_version

Return the current dwapi version
error_message

Deserialize error response object.
insight_create_request

Create insight object for new insights
insight_replace_request

Create insight object for insights that replace existing insights
file_batch_update_request

Create request object for adding or updating dataset files.
parse_success_or_error

Parse simple responses (success or error).
create_project

Create a new project.
get_dataset

Retrieve dataset information.
project_create_request

Create request object for new projects.
sql

Execute SQL query against a dataset.
sparql

Execute SPARQL query against a dataset.
get_project_required_fields

Get the project required fields
stop_on_insights_error

Handle a response containing an error by stopping execution with the embedded message
get_projects_user_contributing

Search for projects contributed-to by the currently authenticated user.
delete_file

Delete a single file from a dataset.
user_agent

Return the dwapi user-agent
file_create_or_update_request

Create object for adding/updating a dataset file.
update_insight

Update an insight.
unlink_dataset

Unlink a dataset from a project.
user_info_response

Deserialize get_user response object.
delete_files

Delete one or more files from a dataset.
get_datasets_user_contributing

Search for datasets contributed-to by the currently authenticated user.
extract_dataset_key

Extract the dataset key from URL or as provided
update_project

Update an existing project.
append_record_to_stream

Append a record, consisting of a list of depth one, to a stream.
update_dataset

Update an existing dataset.
upload_files

Upload one or more files to a dataset.
upload_file

Upload a single file to a dataset.
get_datasets_user_liked

Search for datasets liked by the currently authenticated user.
append_values_to_stream

Append a record, consisting of named parameters, to a stream.
extract_project_key

Extract the project key from URL or as provided
create_project_response

De-serialize a structured list into create_project_reponse object.
get_projects_user_liked

Search for projects liked by the currently authenticated user.
get_projects_user_own

Search for projects owned by the currently authenticated user.
dataset_create_request

Create request object for new datasets.
get_insights

Get insights for a project.
project_replace_request

Create request object for replacement of existing projects.
file_source_create_request

Create object for adding dataset file sources.
get_project

Retrieve a project.
project_update_request

Create request object to update existing projects.
project_summary_response

Deserialize get_project response object.
get_user_library_item

Search for library items owned by, liked by, or contributed-to by the currently authenticated user.
file_source_summary_response

Deserialize get_dataset response file sources.
replace_dataset

Replace an existing dataset.
update_table_schema

Update table schema.
upload_data_frame

Upload a data frame as a file to a dataset.
get_datasets_user_own

Search for datasets owned by the currently authenticated user.
handle_library_err

Stop execution with a message when the response contains an error condition
is.blank

Determine if a value has NA or zero-length character elements, or is NULL
link_dataset

Link a dataset to a project.
replace_insight

Replace an insight.
get_insight

Retrieve an insight.
replace_project

Create a new project with a specific ID, replacing a project with that ID if it exists.
table_schema_field_response

Deserialize get_table_schema fields.
insight_summary_response

Deserialize get_insight response object.
table_schema_field_update_request

Create request object for updating table schema fields.
insight_update_request

Create insight object for updating existing insights
success_message

Deserialize success response object.
sync

Fetch latest files from source and update dataset.
table_schema_response

Deserialize get_table_schema response object.
table_schema_update_request

Create request object for updating table schema.
create_insight

Create an insight.