Skip to contents

Given the number of attributes, generate all possible patterns of attribute mastery.

Usage

create_profiles(attributes)

Arguments

attributes

Positive integer. The number of attributes being measured.

Value

A tibble with all possible attribute mastery profiles. Each row is a profile, and each column indicates whether the attribute in that column was mastered (1) or not mastered (0). Thus, the tibble will have 2^attributes rows, and attributes columns.

Examples

create_profiles(3L)
#> # A tibble: 8 × 3
#>    att1  att2  att3
#>   <int> <int> <int>
#> 1     0     0     0
#> 2     1     0     0
#> 3     0     1     0
#> 4     0     0     1
#> 5     1     1     0
#> 6     1     0     1
#> 7     0     1     1
#> 8     1     1     1
create_profiles(5)
#> # A tibble: 32 × 5
#>     att1  att2  att3  att4  att5
#>    <int> <int> <int> <int> <int>
#>  1     0     0     0     0     0
#>  2     1     0     0     0     0
#>  3     0     1     0     0     0
#>  4     0     0     1     0     0
#>  5     0     0     0     1     0
#>  6     0     0     0     0     1
#>  7     1     1     0     0     0
#>  8     1     0     1     0     0
#>  9     1     0     0     1     0
#> 10     1     0     0     0     1
#> # ℹ 22 more rows