Learn R Programming

rrefine (version 2.1.0)

refine_upload: Upload a file to OpenRefine

Description

This function attempts to upload contents of a file and create a new project in OpenRefine. Users can optionally navigate directly to the running instance to interact with the project. The function wraps the OpenRefine API /command/core/create-project-from-upload query.

Usage

refine_upload(file, project.name = NULL, open.browser = FALSE, ...)

Value

Operates as a side-effect, either opening a browser and pointing to the OpenRefine instance (if open.browser=TRUE) or issuing a message.

Arguments

file

Path to file to upload; upload format is inferred from the file extension, and currently only ".csv" and ".tsv" files are allowed.

project.name

Optional parameter to specify name of the project to be created upon upload; default is NULL and project will be named 'Untitled' in OpenRefine

open.browser

Boolean for whether or not the browser should open on successful upload; default is FALSE

...

Additional parameters to be inherited by refine_path; allows users to specify host and port arguments if the OpenRefine instance is running at a location other than http://127.0.0.1:3333

References

https://docs.openrefine.org/technical-reference/openrefine-api#create-project

Examples

Run this code
if (FALSE) {
fp <- system.file("extdata", "lateformeeting.csv", package = "rrefine")
refine_upload(fp, project.name = "lfm")
write.table(x = mtcars, file = "mtcars.tsv", sep = "\t")
refine_upload(file = "mtcars.tsv", project.name = "mtcars")
}

Run the code above in your browser using DataLab