Skip to contents

Extracts the dataset, its variable metadata (measurement level, value labels) and the list of analyses stored in a .jasp archive. Handles both the legacy binary format and the modern embedded-SQLite format.

Usage

import_jasp(path)

Arguments

path

path to a .jasp file

Value

a list with data (a data.frame; labelled columns carry haven-style label/labels attributes), columns (a data.frame of name and type), analyses (the parsed analyses.json, or NULL), format ("binary" or "sqlite"), and data_file_path (the original source path recorded in the archive, or NA).

Examples

jasp <- system.file("extdata", "sample.jasp", package = "metacheck")
res <- import_jasp(jasp)
head(res$data)
#>   Age Gender Information_page_time Exclude_for_timing Heard_of_procedure
#> 1  20      2                 9.133                  1                  1
#> 2  21      2                12.832                  0                  1
#> 3  20      2                32.733                  0                  1
#> 4  19      2                11.299                  0                  1
#> 5  20      2                10.265                  0                  1
#> 6  20      2                13.510                  0                  1
#>   Previously_participated_in_RHI S1_sync S1_async S2_sync S2_async S3_sync
#> 1                              1       2       -1       2        1       2
#> 2                              0       2        1       1       -1       2
#> 3                              1       2        1       3        1       2
#> 4                              1       2       -2      -1        1      -1
#> 5                              1       2       -1       3       -1       3
#> 6                              1       2        1       1        0      -1
#>   S3_async C1_sync C1_async C2_sync C2_async C3_sync C3_async C4_sync C4_async
#> 1        0       2       -1       2        1       2        1      -1       -1
#> 2        1       1        0       0        0       0       -2       0       -1
#> 3        0       1       -1      -2       -3       3        1      -3       -3
#> 4        2      -2        1      -2        0       0        0      -1        1
#> 5       -1       1        0       2       -1       0        0      -1       -1
#> 6       -1      -1       -1      -2       -2      -2       -2      -3       -3
#>   C5_sync C5_async C6_sync C6_async id S1_time S2_time S3_time C1_time C2_time
#> 1       2       -1       2       -1  1  12.210  14.855  19.207  10.785  11.737
#> 2      -1       -1      -2       -2  2  20.853   8.504   8.704   7.362  20.677
#> 3       1       -1       1       -1  3  13.191  10.085 184.026  17.548  11.260
#> 4      -2        1      -2        1  4   4.740   4.537   6.737   4.257   5.456
#> 5       0       -1       1       -2  5  17.294   7.044   8.924   8.271   6.195
#> 6      -2       -2      -2       -2  6   8.008   5.541   7.304   5.076   5.399
#>   C3_time C4_time C5_time C6_time Illusion_score_sync Illusion_score_async
#> 1   7.722  11.340   8.530   8.530           2.0000000            0.0000000
#> 2   8.478   7.235   7.789   7.788           1.6666667            0.3333333
#> 3 102.887  30.484  14.253  14.252           2.3333333            0.6666667
#> 4   7.335   3.863   3.265   3.265           0.0000000            0.3333333
#> 5   4.683   6.951   8.290   8.289           2.6666667           -1.0000000
#> 6   4.922   4.896   4.726   4.726           0.6666667            0.0000000
#>   control_score_sync control_score_async Expect_question_time_mean
#> 1          1.5000000          -0.3333333                 11.657333
#> 2         -0.3333333          -1.0000000                 10.821111
#> 3          0.1666667          -1.3333333                 44.220667
#> 4         -1.5000000           0.6666667                  4.828333
#> 5          0.5000000          -0.8333333                  8.437889
#> 6         -2.0000000          -2.0000000                  5.622000
#>   Free_response
#> 1            19
#> 2            13
#> 3            21
#> 4            29
#> 5             6
#> 6            27