tidy_iobed_stream: Tidy version of IOBED stream

View source: R/tidy_iobed_stream.R

tidy_iobed_streamR Documentation

Tidy version of IOBED stream

Description

Get a stream pulled by pull_bed_stream and tidy it in a tibble

Usage

tidy_iobed_stream(stream)

Arguments

stream

(chr) a stream from the IOBED connection

Value

a tibble

Note

If the first row is uncompleted it is ignored and a warning is signaled (this should not happen!), on the other hand, if the last row is not completed (almost always!) it is silently ignored.

Examples

sample_stream <- c(
  "2", "7", "8", " ", " ", " ", " ", "2", "2", "5", " ", " ", " ",
  "2", "2", "7", " ", " ", " ", " ", "2", "6", "8", " ", " ", " ",
  " ", "6", "5", "5", "3", "0", " ", " ", " ", " ", " ", "1", "2",
  ":", "4", "4", ":", "1", "4", "/", "2", "0", "0", "\n", "\r", "",
  "2", "7", "8", " ", " ", " ", " ", "2", "2", "5", " ", " ", " ",
  "2", "2", "6", " ", " ", " ", " ", "2", "6", "8", " ", " ", " ",
  " ", "6", "5", "5", "3", "0", " ", " ", " ", " ", " ", "1", "2",
  ":", "4", "4", ":", "1", "4", "/", "2", "0", "1", "\n", "\r", "",
  "2", "7", "8", " ", " ", " ", " ", "2", "2", "5", " ", " ", " "
  )

tidy_iobed_stream(sample_stream)

uscita_stream <- c(
  "2", "7", "9", " ", " ", " ", " ", "2", "2", "5", " ", " ", " ",
  "2", "2", "5", " ", " ", " ", " ", "2", "7", "0", " ", " ", " ",
  " ", "6", "5", "5", "3", "0", " ", " ", " ", " ", " ", "1", "2",
  ":", "5", "0", ":", "2", "t", "i", "p", "o", " ", "u", "s", "c",
  "i", "t", "a", "1", "/", "2", "0", "1", "\n", "\r", "", "2", "7",
  "9", " ", " ", " ", " ", "2", "2", "4", " ", " ", " ", "2", "2",
  "5", " ", " ", " ", " ", "2", "7", "0", " ", " ", " ", " ", "6",
  "5", "5", "3", "0", " ", " ", " ", " ", " ", "1", "2", ":", "5"
)
tidy_iobed_stream(uscita_stream)

UBESP-DCTV/iobed.bed documentation built on Sept. 4, 2022, 5:57 a.m.