Skip to contents

Create unique row identifier

Usage

create_join_column(df, by_colums, new_by_column_name)

Arguments

df

a data.frame or tibble

by_colums

columns to uniquely identify a row

new_by_column_name

the new bs4Dash::column name

Value

join_col_data

Examples

# using dfdiffs::InitialData
InitialData <- dfdiffs::InitialData
create_join_column(df = InitialData,
                    by_colums = c('subject_id', 'record'),
                    new_by_column_name = 'join_var')
#> # A tibble: 5 × 8
#>   join_var subject_id record text_val…¹ text_…² created_…³ updated_…⁴ entered_…⁵
#>   <chr>    <chr>       <dbl> <chr>      <chr>   <date>     <date>     <date>    
#> 1 A-1      A               1 Issue unr… Fatigue 2021-07-29 2021-09-29 2021-09-29
#> 2 A-2      A               2 Issue unr… Fatigue 2021-07-29 2021-10-03 2021-10-29
#> 3 B-3      B               3 Issue res… Fever   2021-07-16 2021-09-02 2021-08-18
#> 4 C-4      C               4 Issue res… Joint … 2021-08-24 2021-10-03 2021-10-03
#> 5 C-5      C               5 Issue res… Joint … 2021-08-24 2021-09-20 2021-10-20
#> # … with abbreviated variable names ¹​text_value_a, ²​text_value_b,
#> #   ³​created_date, ⁴​updated_date, ⁵​entered_date