Title: | Accessing the Peekbank Database |
---|---|
Description: | Tools for connecting to peekbank, an open repository for developmental eye-tracking data. |
Authors: | Mika Braginsky [aut, cre], Kyle MacDonald [aut], Michael Frank [aut] |
Maintainer: | Mika Braginsky <[email protected]> |
License: | GPL-3 |
Version: | 0.1.1.9012 |
Built: | 2024-10-29 02:45:07 UTC |
Source: | https://github.com/langcog/peekbankr |
Connect to Peekbank
connect_to_peekbank(db_version = "current", db_args = NULL, compress = TRUE)
connect_to_peekbank(db_version = "current", db_args = NULL, compress = TRUE)
db_version |
String of the name of database version to use |
db_args |
List with host, user, and password defined |
compress |
Flag to use compression protocol (defaults to TRUE) |
con A DBIConnection object for the peekbank database
con <- connect_to_peekbank(db_version = "current", db_args = NULL) DBI::dbDisconnect(con)
con <- connect_to_peekbank(db_version = "current", db_args = NULL) DBI::dbDisconnect(con)
Get administrations
get_administrations( age = NULL, dataset_id = NULL, dataset_name = NULL, connection = NULL )
get_administrations( age = NULL, dataset_id = NULL, dataset_name = NULL, connection = NULL )
age |
A numeric vector of a single age or a min age and max age (inclusive), in months |
dataset_id |
An integer vector of one or more dataset ids |
dataset_name |
A character vector of one or more dataset names |
connection |
A connection to the peekbank database |
A 'tbl' of Administrations data, filtered down by supplied arguments. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_administrations() get_administrations(age = c()) get_administrations(dataset_name = "pomper_saffran_2016") ## End(Not run)
## Not run: get_administrations() get_administrations(age = c()) get_administrations(dataset_name = "pomper_saffran_2016") ## End(Not run)
Get AOI region sets
get_aoi_region_sets(connection = NULL)
get_aoi_region_sets(connection = NULL)
connection |
A connection to the peekbank database |
A 'tbl' of AOI Region Sets data, filtered down by supplied arguments. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_aoi_region_sets() ## End(Not run)
## Not run: get_aoi_region_sets() ## End(Not run)
Get AOI timepoints
get_aoi_timepoints( dataset_id = NULL, dataset_name = NULL, age = NULL, rle = TRUE, connection = NULL )
get_aoi_timepoints( dataset_id = NULL, dataset_name = NULL, age = NULL, rle = TRUE, connection = NULL )
dataset_id |
An integer vector of one or more dataset ids |
dataset_name |
A character vector of one or more dataset names |
age |
A numeric vector of a single age or a min age and max age (inclusive), in months |
rle |
Logical indicating whether to use RLE data representation or not |
connection |
A connection to the peekbank database |
A 'tbl' of AOI Timepoints data, filtered down by supplied arguments. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_aoi_timepoints(dataset_name = "pomper_saffran_2016") ## End(Not run)
## Not run: get_aoi_timepoints(dataset_name = "pomper_saffran_2016") ## End(Not run)
Get datasets
get_datasets(connection = NULL)
get_datasets(connection = NULL)
connection |
A connection to the peekbank database |
A 'tbl' of Datasets data. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_datasets() ## End(Not run)
## Not run: get_datasets() ## End(Not run)
Get information on database connection options
get_db_info()
get_db_info()
List of database info: host name, current version, supported versions, historical versions, username, password
get_db_info()
get_db_info()
Run a SQL Query script on the Peekbank database
get_sql_query(sql_query_string, connection = NULL)
get_sql_query(sql_query_string, connection = NULL)
sql_query_string |
A valid sql query string character |
connection |
A connection to the Peekbank database |
The database after calling the supplied SQL query
## Not run: get_sql_query("SELECT * FROM datasets") ## End(Not run)
## Not run: get_sql_query("SELECT * FROM datasets") ## End(Not run)
Get stimuli
get_stimuli(dataset_id = NULL, dataset_name = NULL, connection = NULL)
get_stimuli(dataset_id = NULL, dataset_name = NULL, connection = NULL)
dataset_id |
An integer vector of one or more dataset ids |
dataset_name |
A character vector of one or more dataset names |
connection |
A connection to the peekbank database |
A 'tbl' of Stimuli data, filtered down by supplied arguments. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_stimuli() get_stimuli(dataset_name = "pomper_saffran_2016") ## End(Not run)
## Not run: get_stimuli() get_stimuli(dataset_name = "pomper_saffran_2016") ## End(Not run)
Get subjects
get_subjects(connection = NULL)
get_subjects(connection = NULL)
connection |
A connection to the peekbank database |
A 'tbl' of Subjects data. Note that Subjects is a table used to link longitudinal Administrations, which is the primary table you probably want. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_subjects() ## End(Not run)
## Not run: get_subjects() ## End(Not run)
Get trial types
get_trial_types(dataset_id = NULL, dataset_name = NULL, connection = NULL)
get_trial_types(dataset_id = NULL, dataset_name = NULL, connection = NULL)
dataset_id |
An integer vector of one or more dataset ids |
dataset_name |
A character vector of one or more dataset names |
connection |
A connection to the peekbank database |
A 'tbl' of Trial Types data, filtered down by supplied arguments. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_trial_types() get_trial_types(dataset_name = "pomper_saffran_2016") ## End(Not run)
## Not run: get_trial_types() get_trial_types(dataset_name = "pomper_saffran_2016") ## End(Not run)
Get trials
get_trials(dataset_id = NULL, dataset_name = NULL, connection = NULL)
get_trials(dataset_id = NULL, dataset_name = NULL, connection = NULL)
dataset_id |
An integer vector of one or more dataset ids |
dataset_name |
A character vector of one or more dataset names |
connection |
A connection to the peekbank database |
A 'tbl' of Trials data, filtered down by supplied arguments. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_trials() get_trials(dataset_name = "pomper_saffran_2016") ## End(Not run)
## Not run: get_trials() get_trials(dataset_name = "pomper_saffran_2016") ## End(Not run)
Get XY timepoints
get_xy_timepoints( dataset_id = NULL, dataset_name = NULL, age = NULL, connection = NULL )
get_xy_timepoints( dataset_id = NULL, dataset_name = NULL, age = NULL, connection = NULL )
dataset_id |
An integer vector of one or more dataset ids |
dataset_name |
A character vector of one or more dataset names |
age |
A numeric vector of a single age or a min age and max age (inclusive), in months |
connection |
A connection to the peekbank database |
A 'tbl' of XY timepoints data, filtered down by supplied arguments. If 'connection' is supplied, the result remains a remote query, otherwise it is retrieved into a local tibble.
## Not run: get_xy_timepoints(dataset_name = "pomper_saffran_2016") ## End(Not run)
## Not run: get_xy_timepoints(dataset_name = "pomper_saffran_2016") ## End(Not run)
List of peekbank tables
list_peekbank_tables(connection)
list_peekbank_tables(connection)
connection |
A connection to the peekbank database |
A vector of the names of tables in peekbank
## Not run: con <- connect_to_peekbank() list_peekbank_tables(con) ## End(Not run)
## Not run: con <- connect_to_peekbank() list_peekbank_tables(con) ## End(Not run)
Unpack the json sting in the *_aux_data column and turns it into a nested R list
unpack_aux_data(df)
unpack_aux_data(df)
df |
a dataframe in the peekbank format that has an aux data column |
the input dataframe, with the *_aux_data column unpacked
## Not run: subjects_table <- unpack_aux_data(df = subjects_table) ## End(Not run)
## Not run: subjects_table <- unpack_aux_data(df = subjects_table) ## End(Not run)