Skip to contents

Create objects of class profile

Usage

tilt_profile(data)

is_tilt_profile(data)

Arguments

data

A data frame with the column companies_id, and the list columns product and company holding the outputs at product and company level.

Value

An object of class 'profile'.

Examples

library(tibble)
library(tiltIndicator)

product <- company <- tibble(companies_id = 1)
data <- nest_levels(product, company)

class(data)
#> [1] "tbl_df"     "tbl"        "data.frame"

new <- tilt_profile(data)
class(new)
#> [1] "tilt_profile" "tbl_df"       "tbl"          "data.frame"  

tilt_profile(new)
#> # A tibble: 1 × 3
#>   companies_id product          company         
#> *        <dbl> <list>           <list>          
#> 1            1 <tibble [1 × 0]> <tibble [1 × 0]>
is_tilt_profile(new)
#> [1] TRUE