Skip to contents

ar_wordlist_import() import a table of responses from manual spelling correction.

Usage

ar_wordlist_import(
  associations,
  file = "wordlist_correction.csv",
  process_cues = TRUE,
  na = c("NA")
)

Arguments

associations

an associatoR object containing association data as generated by ar_import.

file

a character string specifying the filename containing the file spelling correction table exported by ar_wordlist_export. Must be a .CSV file and contain columns c("response", "response_correct"). Default name is "wordlist_correction.csv".

process_cues

a logical indicating if cues should be processed (i.e. changed by fun) or not.

na

a character vector indicating the values signifying invalid values. Devaults to c("NA").

Value

Writes a .CSV file containing a list of unique responses plus additional information.

References

Aeschbach, S., Mata, R., Wulff, D. U. (in preparation)

Examples


ar_obj = ar_import(intelligence,
                   participant = participant_id,
                   cue = cue,
                   response = response,
                   participant_vars = c(gender, education),
                   response_vars = c(response_position, response_level)) %>%
  ar_normalize_manual(trimws, which = "left")

ar_wordlist_import(ar_obj)
#> Warning: One or more parsing issues, call `problems()` on your data frame for details,
#> e.g.:
#>   dat <- vroom(...)
#>   problems(dat)
#> Rows: 9973 Columns: 6
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (4): response, spelling_check, acronym_check, acronym_candidate
#> dbl (1): response_frequency
#> lgl (1): response_correct
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> 
#> ── An associatoR object ────────────────────────────────────────────────────────
#> 
#> participants
#> # A tibble: 1,000 × 3
#>      id gender education  
#>   <dbl> <chr>  <chr>      
#> 1     1 male   high school
#> 2     2 male   high school
#> 3     3 male   high school
#> 4     4 male   high school
#> 5     5 male   high school
#> # ℹ 995 more rows
#> 
#> cues
#> # A tibble: 804 × 2
#>   cue          cue_orig    
#>   <chr>        <chr>       
#> 1 intelligence intelligence
#> 2 Einstein     Einstein    
#> 3 books        books       
#> 4 IQ tests     IQ tests    
#> 5 college      college     
#> # ℹ 799 more rows
#> 
#> responses
#> # A tibble: 29,882 × 7
#>      id cue          response response_position response_level response_original
#>   <dbl> <chr>        <chr>                <dbl>          <dbl> <chr>            
#> 1     1 intelligence Einstein                 1              1 Einstein         
#> 2     1 intelligence books                    2              1 books            
#> 3     1 intelligence IQ tests                 3              1 IQ tests         
#> 4     1 intelligence college                  4              1 college          
#> 5     1 intelligence smart p…                 5              1 smart people     
#> # ℹ 29,877 more rows
#> # ℹ 1 more variable: cue_orig <chr>
#>