Title: | Read Key/Value Pair Observations |
---|---|
Description: | This package provides functionality to read files containing observations which consist of arbitrary key/value pairs. |
Authors: | Vehbi Sinan Tunalioglu [aut, cre] |
Maintainer: | Vehbi Sinan Tunalioglu <[email protected]> |
License: | GPL-3 |
Version: | 0.1 |
Built: | 2025-02-05 03:55:12 UTC |
Source: | https://github.com/vst/rkvo |
Provides the workhorse function to read key/value pair observations from a flat file. Note that, same keys and corresponding values in the same observation are returned as vectors.
path |
The path to the input file. |
delim_tuple |
The tuple deliminator. |
delim_field |
The field deliminator. |
A list of observations. Each observation is a named list of key/value pairs.
## Not run: ## Assume that we have a file at path "file.dat" with the ## following contents: ## ## key1=value11;key2=value12 ## key1=value21;key2=value22 ## key1=value31;key2=value320;key2=value321 ## ## Let's read this in and display as a matrix: observations <- readkvs("file.dat", ";", "=") do.call(rbind, observations) ## End(Not run)
## Not run: ## Assume that we have a file at path "file.dat" with the ## following contents: ## ## key1=value11;key2=value12 ## key1=value21;key2=value22 ## key1=value31;key2=value320;key2=value321 ## ## Let's read this in and display as a matrix: observations <- readkvs("file.dat", ";", "=") do.call(rbind, observations) ## End(Not run)
This package provides functionality to read files containing observations which consist of arbitrary key/value pairs.