Skip to contents

Converts a comma-separated PCIbex results file into rectangular format.

Usage

read_pcibex(file, encoding = "UTF-8", exclude_controller_name = FALSE, ...)

Arguments

file

Path to the results file

encoding

The name of the encoding to be assumed.

exclude_controller_name

For backwards compatibility, whether to skip the column for "Controller name". In a previous version of PCIbex (last checked: September 2021), "Controller name" appeared in the column specification as the third column but does not have associated values in the results. This has since been fixed, so the value is set to FALSE by default.

...

Passed to type.convert(), or readr::type_convert() if tidyverse is installed.

Value

A dataframe

Examples

# \dontrun{
# It takes a few seconds because it's reading from remote
# but the parsing itself is very fast.
dplyr::glimpse(
  read_pcibex(
    "https://raw.githubusercontent.com/yjunechoe
     /Semantic-Persistence/master/data/result.txt",
    exclude_controller_name = FALSE
  )
)
#> 
#> -- Column specification --------------------------------------------------------
#> cols(
#>   Time_results_were_received = col_double(),
#>   MD5_hash_of_participant_s_IP_address = col_character(),
#>   Controller_name = col_character(),
#>   Item_number = col_double(),
#>   Element_number = col_double(),
#>   Type = col_character(),
#>   Group = col_character(),
#>   PennElementType = col_character(),
#>   PennElementName = col_character(),
#>   Parameter = col_character(),
#>   Value = col_character(),
#>   EventTime = col_character(),
#>   Comments = col_character(),
#>   Item = col_character(),
#>   Cond = col_character(),
#>   Group_1 = col_character(),
#>   Participant_ID = col_character()
#> )
#> Rows: 23,302
#> Columns: 17
#> $ Time_results_were_received           <dbl> 1586129536, 1586129536, 158612953~
#> $ MD5_hash_of_participant_s_IP_address <chr> "ed21346ef6cb189471f1665c27e1065e~
#> $ Controller_name                      <chr> "PennController", "PennController~
#> $ Item_number                          <dbl> 0, 0, 2, 2, 3, 3, 3, 4, 4, 4, 5, ~
#> $ Element_number                       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ~
#> $ Type                                 <chr> "consent", "consent", "intro", "i~
#> $ Group                                <chr> "NULL", "NULL", "NULL", "NULL", "~
#> $ PennElementType                      <chr> "PennController", "PennController~
#> $ PennElementName                      <chr> "0", "0", "2", "2", "3", "b7dbb12~
#> $ Parameter                            <chr> "_Trial_", "_Trial_", "_Trial_", ~
#> $ Value                                <chr> "Start", "End", "Start", "End", "~
#> $ EventTime                            <chr> "1586129111186", "1586129125480",~
#> $ Comments                             <chr> "NULL", "NULL", "NULL", "NULL", "~
#> $ Item                                 <chr> NA, NA, NA, NA, NA, NA, NA, NA, N~
#> $ Cond                                 <chr> NA, NA, NA, NA, NA, NA, NA, NA, N~
#> $ Group_1                              <chr> NA, NA, NA, NA, NA, NA, NA, NA, N~
#> $ Participant_ID                       <chr> NA, NA, NA, NA, NA, NA, NA, NA, N~
# }