Skip to contents

Small wrapper around the function dplyr::bind_rows(). Converts first a custom amount of variables in a list of data frames to character, and then combines the list of data frames into one data frame.

Usage

bind_rows_custom(data, convert = "item_value")

Arguments

data

A list of data frames.

convert

A character vector containing the column names of the columns that need to be converted.

Value

A data frame object.

Examples

 data_list <- list(
   data.frame(
      "ID" = c("subj_1", "subj_5", "subj_8"),
      "values" = c("1", "4", "7")
   ),
   data.frame(
      "ID" = c("subj_7", "subj_9", NA_character_),
      "values" = c(10, 12, 5)
   )
 )
bind_rows_custom(data_list, "values")
#>       ID values
#> 1 subj_1      1
#> 2 subj_5      4
#> 3 subj_8      7
#> 4 subj_7     10
#> 5 subj_9     12
#> 6   <NA>      5