build_element_apply: Convert dataframe columns into html elements, then reduce to...

build_element_applyR Documentation

Convert dataframe columns into html elements, then reduce to single string

Description

Convert dataframe columns into html elements, then reduce to single string

Usage

build_element_apply(
  df,
  pre,
  post,
  df.names = names(df),
  skipEmpty = TRUE,
  collapse = "",
  reduce = TRUE
)

Arguments

df

input dataframe

pre

Dataframe with string columns and same names as df. Each column in pre contains a string value to append before the corresponding column in df. Includes a Body column, to be appended before the aggregated output.

post

Dataframe with string columns and same names as df. Each column in post contains a string value to append before the corresponding column in df. Includes a Body column, to be appended after the aggregated output.

df.names

names of columns to use

skipEmpty

If True, null values of str will be converted to ”.

Value

character

Examples

  df_pre = tibble::tibble(x='<x>', y='<y>' ,Body='(')
  df_post = tibble::tibble(x= '<x>', y='</y>', Body=')')
  build_element_apply(tibble::tibble(x=c('hello','world'),y=c('1', '2')), df_pre, df_post)
  

capelastegui/sfrpg documentation built on June 13, 2022, 1:38 a.m.