Resource client

Resource client

Format

A R6 object of class ResourceClient

Details

Helper class for connecting to a resource data store or a computation unit.

Methods


Method new()

Creates a ResourceClient instance.

Usage

ResourceClient$new(resource)

Arguments

resource

The resource object to be interprated.

Returns

A ResourceClient object.


Method getResource()

Get the resource object.

Usage

ResourceClient$getResource()

Returns

The resource object.


Method getConnection()

Get the implementation-specific object that connects to the resource

Usage

ResourceClient$getConnection()

Returns

The connection object.


Method downloadFile()

Stub function to be implemented by subclasses if relevant. Get the resource as a local file.

Usage

ResourceClient$downloadFile(...)

Arguments

...

Additional parameters.

Returns

The path to the local file.


Method asDataFrame()

Stub function to be implemented by subclasses if relevant. Coerce the resource as a data.frame.

Usage

ResourceClient$asDataFrame(...)

Arguments

...

Additional parameters.

Returns

A data.frame object (can also be a tibble).


Method asTbl()

Stub function to be implemented by subclasses if relevant. Coerce the resource as a dplyr's tbl.

Usage

ResourceClient$asTbl(...)

Arguments

...

Additional parameters.

Returns

A dplyr's tbl object.


Method exec()

Stub function to be implemented by subclasses if relevant. Executes a command on a computation resource.

Usage

ResourceClient$exec(...)

Arguments

...

Additional parameters that will represent the command to execute.

Returns

A command execution result object.


Method close()

Silently closes the connection to the resource

Usage

ResourceClient$close()


Method clone()

The objects of this class are cloneable with this method.

Usage

ResourceClient$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.