“Happy families are all alike; every unhappy family is unhappy in its own way.”
Leo Tolstoy’s Anna Karenina
(by way of Wickham, 2014)
Based on Jenny Bryan’s work
Based on Jenny Bryan’s work
A standard for storing and describing neuroimaging data
key1-value_key2-value_suffix.extension
sub-control1
, task-nback
are entitiesT1w
and bold
are suffixes.nii.gz
and .tsv
are extensions> Sys.glob("~/AFQ_data/HBN/derivatives/afq/sub-*/ses-*/*model-DTI*.nii.gz")
[1] "/Users/arokem/AFQ_data/HBN/derivatives/afq/sub-NDARAA948VFH/ses-HBNsiteRU/sub-NDARAA948VFH_ses-HBNsiteRU_acq-64dir_space-T1w_desc-preproc_dwi_model-DTI_FA.nii.gz"
[2] "/Users/arokem/AFQ_data/HBN/derivatives/afq/sub-NDARAA948VFH/ses-HBNsiteRU/sub-NDARAA948VFH_ses-HBNsiteRU_acq-64dir_space-T1w_desc-preproc_dwi_model-DTI_diffmodel.nii.gz"
[3] "/Users/arokem/AFQ_data/HBN/derivatives/afq/sub-NDARAV554TP2/ses-HBNsiteRU/sub-NDARAV554TP2_ses-HBNsiteRU_acq-64dir_space-T1w_desc-preproc_dwi_model-DTI_FA.nii.gz"
[4] "/Users/arokem/AFQ_data/HBN/derivatives/afq/sub-NDARAV554TP2/ses-HBNsiteRU/sub-NDARAV554TP2_ses-HBNsiteRU_acq-64dir_space-T1w_desc-preproc_dwi_model-DTI_diffmodel.nii.gz"
YYYYMMDD
format (but could also use YYYY-MM-DD
)“Data about data”
{
"age": {
"Description": "age of the participant",
"Units": "year"
},
"sex": {
"Description": "sex of the participant as reported by the participant",
"Levels": {
"M": "male",
"F": "female"
}
},
"handedness": {
"Description": "handedness of the participant as reported by the participant",
"Levels": {
"left": "left",
"right": "right"
}
},
"group": {
"Description": "experimental group the participant belonged to",
"Levels": {
"read": "participants who read an inspirational text before the experiment",
"write": "participants who wrote an inspirational text before the experiment"
}
}
}
treatmenta | treatmentb | |
---|---|---|
John Smith | NA | 2 |
Jane Doe | 16 | 11 |
Mary Johnson | 3 | 1 |
John Smith | Jane Doe | Mary Johnson | |
---|---|---|---|
treatmenta | NA | 16 | 3 |
treatmentb | 2 | 11 | 1 |
Person | Treatment | Result |
---|---|---|
John Smith | a | NA |
Jane Doe | a | 16 |
Mary Johnson | a | 3 |
John Smith | b | 2 |
Jane Doe | b | 11 |
Mary Johnson | b | 1 |
density
is the ratio of weight
to volume
.a
vs. Treatment b
.tidyr
) to deal with some of these.dplyr
ggplot2
lme4
etc.Using dplyr
group_by %>% summarize
filter %>% group_by %>% summarise
filter %>% group_by %>% summarise %>% aggregate
Let’s look at this with a hands-on example