| Title: | Iker Is Your Data Scribe |
|---|---|
| Description: | Iker defines itself as a Scribe - a person who copies out documents. The package is meant to read / write data and provide various connectors. |
| Authors: | Philippe Peret [aut, cre, cph] (ORCID: <https://orcid.org/0009-0003-9666-7490>) |
| Maintainer: | Philippe Peret <[email protected]> |
| License: | GPL-3 + file LICENSE |
| Version: | 0.9.5 |
| Built: | 2026-10-01 20:30:22 UTC |
| Source: | https://github.com/thekangaroofactory/iker |
Convert POSIXct Columns to ISO-8601 Character
from_POSIXct(data)from_POSIXct(data)
data |
a data.frame (expected to contain POSIXct columns) |
a data.frame, whose POSIXct columns have been converted to ISO-8601 character columns
from_POSIXct(data.frame(a = Sys.time()))from_POSIXct(data.frame(a = Sys.time()))
Load Data From Various Connectors
load_data(..., verbose = FALSE, data.frame = FALSE, force_empty = FALSE)load_data(..., verbose = FALSE, data.frame = FALSE, force_empty = FALSE)
... |
arguments to pass to connector (see details) |
verbose |
a logical (default = FALSE) to indicate if additional traces should be sent to the console |
data.frame |
a logical (default = FALSE) if a data.frame should be returned (instead of a tibble) |
force_empty |
a logical (default = FALSE) if NULL should be returned when data has no row |
The load_data function is a wrapper around connector functions. It offers a single point of access to the package data persistence features.
Arguments passed to ... depend on the desired connector:
file: read_data
the output of the connector function
## Not run: # -- file connector load_data(file = "my_data.csv", path = getwd()) ## End(Not run)## Not run: # -- file connector load_data(file = "my_data.csv", path = getwd()) ## End(Not run)
Read Data
read_data( path = Sys.getenv("DATA_HOME"), resource = NULL, file, delim = ",", col_types = NULL, verbose = FALSE )read_data( path = Sys.getenv("DATA_HOME"), resource = NULL, file, delim = ",", col_types = NULL, verbose = FALSE )
path |
A path where to read the data (see details). |
resource |
An optional resource name (used as sub folder inside path). |
file |
The name of the file to read (with extension). |
delim |
Single character used to separate fields within a record. |
col_types |
See read_delim function from readr package. |
verbose |
A logical whether additional trace should be sent to the console. |
By default, path takes its value from the DATA_HOME environment variable. If it's not set in the environment and no value has been provided, function will be stopped (and return NULL). When NULL, it will be ignored (assuming file contains the full path to the file)
col_types will be used to detect if POSIXct columns are expected. In this case they will be read as character first (expecting an ISO-8601 compatible string) then converted to POSIXct.
A tibble, output value of the read_delim() call or NULL if data can't be read.
## Not run: foo <- read_data(file = "my_data.csv") ## End(Not run)## Not run: foo <- read_data(file = "my_data.csv") ## End(Not run)
Save Data To Various Connectors
save_data(..., verbose = FALSE)save_data(..., verbose = FALSE)
... |
arguments to pass to connector (see details) |
verbose |
a logical (default = FALSE) to indicate if additional traces should be sent to the console |
The save_data function is a wrapper around connector functions. It offers a single point of access to the package data persistence features.
Arguments passed to ... depend on the desired connector:
file: write_data
the output of the connector function
## Not run: # -- file connector save_data(file = "my_data.csv", path = getwd()) ## End(Not run)## Not run: # -- file connector save_data(file = "my_data.csv", path = getwd()) ## End(Not run)
Convert ISO-8601 Character Columns to POSIXct
to_POSIXct(data, names_ct)to_POSIXct(data, names_ct)
data |
a data.frame |
names_ct |
the names of the columns to convert |
a data.frame with converted columns
to_POSIXct(data.frame(a = "2025-05-13T12:15:30+0200"), "a")to_POSIXct(data.frame(a = "2025-05-13T12:15:30+0200"), "a")
Write Data
write_data( x, path = Sys.getenv("DATA_HOME"), resource = NULL, file, delim = ",", verbose = FALSE )write_data( x, path = Sys.getenv("DATA_HOME"), resource = NULL, file, delim = ",", verbose = FALSE )
x |
A data frame to write to disk. |
path |
A path where to write the data (see details). |
resource |
An optional resource name (used as sub folder inside path). |
file |
The name of the file to write (with extension) |
delim |
Single character used to separate fields within a record. |
verbose |
If TRUE, additional messages will be sent to the console |
By default, path takes its value from the DATA_HOME environment variable. If it's not set in the environment and no value has been provided, function will be stopped (and return FALSE). If the corresponding path does not exist, it won't be created - to avoid creating data inside a container if the mount has not been done for example. When NULL, no check will be done.
Resource is an optional parameter to allow the use of sub folder inside path. If not NULL, it will be concatenated to path (and created inside path if it does not exist) When path is NULL, it will be ignored.
Columns with POSIXct type will be converted to ISO-8601 character columns before writing the file
returns the input x invisibly, or FALSE when it fails
## Not run: write_data(foo, file = "my_data.csv") ## End(Not run)## Not run: write_data(foo, file = "my_data.csv") ## End(Not run)