free_text_wordcloud: Generates a wordcloud based on text from free text questions...

Description Usage Arguments Value Examples

View source: R/free_text_wordcloud.R

Description

The main computation, namely the creation of the corpus, the preprocessing of the text in the corpus and the generation of the wordcloud is done through the function preprocess_wc_generation. This function serves as a wrapper that applies the collection_period to every free text question column that the user specified in the argument text_col.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
free_text_wordcloud(
  svc = FALSE,
  df = NULL,
  csv = NULL,
  text_col,
  lang_wc,
  lang = NULL,
  df_schema_ext = NULL,
  choice_col = NULL,
  label_col = NULL
)

Arguments

svc

Logical that indicates whether the data shall be parsed using ruODK's odata_submission_get. Optional, defaults to FALSE.

df

Data frame containing the ODK data that is to be used. Optional, defaults to NULL.

csv

Character that specifies the path to the csv file that is to be read. Optional, defaults to NULL.

text_col

Character or Character vector (if multiple questions shall be examined) that specifies the names of the columns of the free text questions.

lang_wc

Character that specifies the language of the answers of the free text question. Check stopwords to find out more about stopwords list options.

lang

Character that specifies the language of the answers of the free text question. Check stopwords to find out more about stopwords list options.

df_schema_ext

Data frame that defines the schema of the from. Can be passed to the function to avoid downloading it multiple times. Optional, defaults to NULL.

choice_col

String specifying the choices column that is to be changed, defaults to NULL.

label_col

String specifying the labels column that is to be changed, defaults to NULL.

Value

List

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# 1. with SVC
# ruODK needs to be set up for this function to work
repvisforODK::setup_ruODK(svc = example/svc.svc, un = exampleusername, pw = examplepassword, tz = 'Europe/Berlin', verbose = TRUE)

free_text_wordcloud(svc = TRUE, text_col = c('question2', 'question5'), lang_wc = 'french', lang = 'english', delimiter = ' ', choice_col = 'choices_english_(en)', label_col = 'label_english_(en)')

# 2. with data frame and external form schema
df_schema = ruODK::form_schema_ext()

free_text_wordcloud(df = df_odk_data, text_col = c('question2', 'question5'), lang_wc = 'french', lang = 'english', df_schema_ext = df_schema, delimiter = ' ', choice_col = 'choices_english_(en)', label_col = 'label_english_(en)')

# 3. with csv and qvec
free_text_wordcloud(csv = 'example/file/odk_data.csv', text_col = c('question2', 'question5'), lang_wc = 'french', lang = 'english', qvec = c('question1', 'question4'), delimiter = ' ', choice_col = 'choices_english_(en)', label_col = 'label_english_(en)')

## End(Not run)

lucidviews/repvisForODK documentation built on Feb. 13, 2022, 9:50 p.m.