Skip to contents

Note that if the column order is set in the xlsform choice part, the variable will be de factor considered as ordinal and the default ordering will not be done based on frequency

Usage

plot_select_multiple(
  datalist = datalist,
  dico = dico,
  var,
  datasource = NULL,
  n = NULL,
  showcode = FALSE
)

Arguments

datalist

An object of the "datalist" class as defined in kobocruncher

dico

An object of the "kobodico" class format as defined in kobocruncher

var

name of the variable to display

datasource

name of the data source to display, if set to NULL - then pulls the form_title within the settings of the xlsform

n

if not NULL, lumps all levels except for the n most frequent (or least frequent if n < 0) - cf forcats::fct_lump_n()

showcode

display the code

Examples

dico <- kobo_dico( xlsformpath = system.file("sample_xlsform.xlsx", package = "kobocruncher") )
datalist <- kobo_data(datapath = system.file("data.xlsx", package = "kobocruncher") )


plot_select_multiple(datalist = datalist,
              dico = dico, 
              var = "profile.reason",
              datasource = NULL,
              showcode = TRUE
            )
#> Why did you left?
#> `plot_select_multiple(datalist, dico, "profile.reason", datasource=params$datasource, n=7)` 
#> 
#>  


## Displaying the usage of the lumping option..
plot_select_multiple(datalist = datalist,
              dico = dico, 
              var = "profile.reason",
              n = 5,
             datasource = NULL,
              showcode = TRUE
            )
#> Why did you left?
#> `plot_select_multiple(datalist, dico, "profile.reason", datasource=params$datasource, n=5)` 
#> 
#>  


# plot_select_multiple(datalist = datalist,
#               dico = dico, 
#               var = "profile.reason1",
#               showcode = TRUE
#             )