Learn R Programming

bidsr (version 0.1.1)

get_bids_entity: Get 'BIDS' entity values from file

Description

Get 'BIDS' entity values from file

Usage

get_bids_entity(x, key, value_only = TRUE, ifnotfound = NULL)

get_bids_entity_rules(x)

Value

'BIDS' entity value or object, depending on value_only

Arguments

x

'BIDS' file path or parsed object; see 'Examples'

key

entity key

value_only

whether to return the value only; default is true; set to FALSE to return the entity object

ifnotfound

default value to return is the entity is missing

Author

Zhengjia Wang

Examples

Run this code

# Quick usage
get_bids_entity("ieeg/sub-YAB_ses-01_task-AV_ieeg.mat", "sub")

get_bids_entity_rules("ieeg/sub-YAB_ses-01_task-AV_channels.tsv")

# Full usage
parsed <- parse_path_bids_entity(
    path = "ieeg/sub-YAB_ses-01_task-AV_channels.tsv")

parsed$get_bids_entity("sub")
parsed$get_bids_entity_rules()

parsed$description
parsed$entities

Run the code above in your browser using DataLab