refine_upload: Upload a file to OpenRefine

View source: R/refine_upload.R

refine_uploadR Documentation

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, ...)

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

Value

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

References

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

Examples

## Not run: 
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")

## End(Not run)


rrefine documentation built on Nov. 16, 2022, 1:09 a.m.