Skip to contents

Print a TNA Data Object

Usage

# S3 method for class 'tna_data'
print(x, data = "sequence", ...)

Arguments

x

A tna_data object.

data

A character string that defines the data to be printed tibble. Accepts either "sequence" (default) for wide format sequence data, "meta", for the wide format metadata, or "long" for the long format data.

...

Arguments passed to the tibble print method.

Value

x (invisibly).

Examples

data_single_session <- tibble::tibble(
  action = c(
    "view", "click", "add_cart", "view", "checkout", "view", "click", "share"
   )
)
results_single <- prepare_data(data_single_session, action = "action")
#> ── Preparing Data ──────────────────────────────────────────────────────────────
#>  Input data dimensions: 8 rows, 1 columns
#>  No `time` or `order` column provided. Treating the entire dataset as one
#>   session.
#>  Total number of sessions: 1
#>  Total number of actions: 8
#>  Maximum sequence length: 8 actions
#>  Top 5 longest sessions:
#>   session: 8
print(results_single, which = "sequence")
#> # A tibble: 1 × 8
#>   T1    T2    T3       T4    T5       T6    T7    T8   
#>   <chr> <chr> <chr>    <chr> <chr>    <chr> <chr> <chr>
#> 1 view  click add_cart view  checkout view  click share
print(results_single, which = "meta")
#> # A tibble: 1 × 8
#>   T1    T2    T3       T4    T5       T6    T7    T8   
#>   <chr> <chr> <chr>    <chr> <chr>    <chr> <chr> <chr>
#> 1 view  click add_cart view  checkout view  click share
print(results_single, which = "long")
#> # A tibble: 1 × 8
#>   T1    T2    T3       T4    T5       T6    T7    T8   
#>   <chr> <chr> <chr>    <chr> <chr>    <chr> <chr> <chr>
#> 1 view  click add_cart view  checkout view  click share