View source: R/tidy_iobed_stream.R
tidy_iobed_stream | R Documentation |
Get a stream pulled by pull_bed_stream and tidy it in a tibble
tidy_iobed_stream(stream)
stream |
(chr) a stream from the IOBED connection |
a tibble
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.