refine_operations: Apply operations to OpenRefine project

View source: R/refine_operations.R

refine_operationsR Documentation

Apply operations to OpenRefine project

Description

This function allows users to pass arbitrary operations to an OpenRefine project via an API query to /command/core/apply-operations. The operations to perform must be formatted as valid JSON and passed to this function as a list object.

Usage

refine_operations(
  project.name = NULL,
  project.id = NULL,
  verbose = FALSE,
  operations,
  ...
)

Arguments

project.name

Name of project

project.id

Unique identifier for project

verbose

Logical specifying whether or not query result should be printed; default is FALSE

operations

List of operations to perform

...

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 passing operations to the OpenRefine instance. However, if verbose=TRUE then the function will return an object of the class "response".

References

https://docs.openrefine.org/technical-reference/openrefine-api#apply-operations

Examples

## Not run: 
fp <- system.file("extdata", "lateformeeting.csv", package = "rrefine")
refine_upload(fp, project.name = "lfm")

ops <-
   list(
       op = "core/text-transform",
       engineConfig = list(mode = "row-based", facets = list()),
       columnName = "was i on time for work",
       expression = "value.toUppercase()",
       onError = "set-to-blank")

refine_operations(project.name = "lfm", operations = list(ops), verbose = TRUE)

## End(Not run)


vpnagraj/rrefine documentation built on Nov. 21, 2022, 12:20 a.m.