A new tbl_mbte
based on x
is created. The corresponding
column names for the `time`-, `value`-, `signal`- and `fits` columns are
passed as parameters as either strings or symbols
.
If symbols are passed, quasiquotation should be used.
new_tbl_mbte(x, time, value, ..., signal = "signal", fits = "fits", subclass = NULL)
x | A data.frame or tibble. |
---|---|
time | The name of the time-column (gets quoted). |
value | The name of the value column (measurement-data) - gets quoted. |
... | Additional attributes, that are set (must be named). |
signal | A name for a list column, in which tibbles containing the signal (time- and value- column combined) get stored - gets quoted. |
fits | List-column-name; The predicted values for the original signal get stored in this list-column - gets quoted. |
subclass | Additional classes to inherit from (character). |
A tbl_mbte
wrapping x
will be returned. The resulting
object is a tibble
under the hood and can be used
as such.
Errors about missing or malformatted columns will not be rasised by this function.
raw_signals
(dataset used in examples)
Other tbl_mbte functions: is_tbl_mbte
,
mbte_reconstruct
, tbl_mbte
# NOT RUN { new_tbl_mbte(raw_signals, time = t, value = value) # }# pass column names as strings new_tbl_mbte(raw_signals, time = "t", value = "value")#> # A tibble: 4,200 x 3 #> t mv value #> <int> <chr> <dbl> #> 1 1 mv1 0 #> 2 2 mv1 0 #> 3 3 mv1 0 #> 4 4 mv1 0 #> 5 5 mv1 0 #> 6 6 mv1 0 #> 7 7 mv1 0 #> 8 8 mv1 0 #> 9 9 mv1 0 #> 10 10 mv1 0 #> # … with 4,190 more rows# pass symbols using quasiquotation time_sym <- rlang::sym("t") value_sym <- rlang::sym("value") new_tbl_mbte(raw_signals, time = !!time_sym, value = !!value_sym)#> # A tibble: 4,200 x 3 #> t mv value #> <int> <chr> <dbl> #> 1 1 mv1 0 #> 2 2 mv1 0 #> 3 3 mv1 0 #> 4 4 mv1 0 #> 5 5 mv1 0 #> 6 6 mv1 0 #> 7 7 mv1 0 #> 8 8 mv1 0 #> 9 9 mv1 0 #> 10 10 mv1 0 #> # … with 4,190 more rows