one_hot_single_row_ems_data: Creates one-hot-matrix of terms in narrative and binds to...

Description Usage Arguments Value Examples

View source: R/formatting.R

Description

Creates one-hot-matrix of terms in narrative and binds to data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
one_hot_single_row_ems_data(
  data_in,
  narrative_col_to_one_hot = "care_narrative_adj",
  complaint_col_to_one_hot = "primary_complaint_adj",
  words = dplyr::pull(dplyr::select(dplyr::filter(overdoseR:::high_value_terms,
    .data$type == "word"), .data$token)),
  bigrams = dplyr::pull(dplyr::select(dplyr::filter(overdoseR:::high_value_terms,
    .data$type == "bigram"), .data$token)),
  trigrams = dplyr::pull(dplyr::select(dplyr::filter(overdoseR:::high_value_terms,
    .data$type == "trigram"), .data$token))
)

Arguments

data_in

Formatted data to use

narrative_col_to_one_hot

Field name for specific narrative to one-hot

complaint_col_to_one_hot

Field name for specific complaint to one-hot

words

Words to tokenize on, defaults to high_value_terms

bigrams

Bigrams to tokenize on, defaults to high_value_terms

trigrams

Trigrams to tokenize on, defaults to high_value_terms

Value

Dataframe of inputted data and one-hot fields from narrative and primary complaint (pc_)

Examples

1
## Not run: one_hot_single_row_ems_data(formatted_data_frame)

anpatton/overdoseR documentation built on July 16, 2020, 1:53 a.m.