EprimeFrame: Create an EprimeFrame object

Description Usage Arguments Value Examples

View source: R/frames.R

Description

This constructor function converts a character vector into an EprimeFrame object, which is just a list with some special metadata values. Strings with the format "key: value" are parsed into key = value list items (via listify).

Usage

1
EprimeFrame(keys_values)

Arguments

keys_values

a character vector of containing some "key: value" strings.

Value

a list with the class EprimeFrame and with special Eprime. metadata, Running and Procedure values, all set to NA by default.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Default metadata values
lines <- c(
  "key: value",
  "question: answer",
  "garbage text")

EprimeFrame(lines)
# List of 8
# $ Eprime.Level      : num 1
# $ Eprime.LevelName  : logi NA
# $ Eprime.Basename   : logi NA
# $ Eprime.FrameNumber: logi NA
# $ Procedure         : logi NA
# $ Running           : logi NA
# $ key               : chr "value"
# $ question          : chr "answer"

# Normalize [Running] related lines
keys_values <- c(
  "Running: Demo",
  "Demo: ExampleCode",
  "Demo.Cycle: 1",
  "Demo.Sample: 1",
  "Key: Value")

EprimeFrame(keys_values)
# List of 9
# $ Eprime.Level      : num 1
# $ Eprime.LevelName  : chr "Demo_ExampleCode"
# $ Eprime.Basename   : logi NA
# $ Eprime.FrameNumber: logi NA
# $ Procedure         : logi NA
# $ Running           : chr "Demo"
# $ Cycle             : chr "1"
# $ Sample            : chr "1"
# $ Key               : chr "Value"

tjmahr/rprime documentation built on Sept. 30, 2020, 5:31 p.m.