write_acttrust: Adapt and write a 'tsibble' to a readable ActTrust file

View source: R/write_acttrust.R

write_acttrustR Documentation

Adapt and write a tsibble to a readable ActTrust file

Description

[Experimental]

write_acttrust() allows you to adapt and write a tsibble object to a readable ActTrust file.

Note that your data must conform to a predefined structure. See ?acttrust to learn more.

ActTrust is a trademark of Condor Instruments Ltda.

Usage

write_acttrust(data, file, delim = ";", header = NULL)

Arguments

data

A tsibble object with a POSIXt index. The ActTrust software only deals with this type of index.

file

A string with a file path to write to.

delim

(optional) a string indicating the delimiter that must be used to separate values. Valid delimiters are: ";" and "\t" (default: ";").

header

(optional) a string indicating the path to a file (usually the raw data file) with the ActTrust header. This is not mandatory, the ActTrust software can read files without it (default: NULL).

Details

Requirements

write_acttrust() requires the readr package. If you don't already have it installed, you can install it with:

install.packages("readr")

NA values

write_acttrust() will transform any NA value to 0. This is because the ActTrust software only deals with numeric values.

Value

An invisible NULL. This function don't aim to return values.

See Also

Other utility functions: aggregate_index(), find_epoch(), raw_data(), read_acttrust()

Examples

acttrust

file <- tempfile()
header <- raw_data("acttrust.txt")

write_acttrust(acttrust, file, header = header)

readLines(file, n = 30)

gipsousp/actverse documentation built on Oct. 6, 2023, 12:21 a.m.