Learn R Programming

freesurfer (version 1.6.10)

read_fs_table: Read Freesurfer Table Output

Description

This function reads output from a Freesurfer table command, e.g. aparcstats2table, asegstats2table

Usage

read_fs_table(file, sep = NULL, stringsAsFactors = FALSE, header = TRUE, ...)

Value

data.frame from the file

Arguments

file

(character path) filename of text file

sep

separator to override attribute of file, to pass to read.table.

stringsAsFactors

(logical) passed to read.table

header

Is there a header in the data

...

additional arguments to read.table

Examples

Run this code
if (have_fs()) {
   outfile = aparcstats2table(subjects = "bert",
                    hemi = "lh",
                    meas = "thickness")
   df = read_fs_table(outfile)
   seg_outfile = asegstats2table(subjects = "bert", meas = "mean")
   df_seg = read_fs_table(seg_outfile)
}
if (FALSE) {
### using the pipe
if (requireNamespace("magrittr", quietly = TRUE)) {
df_seg = asegstats2table(subjects = "bert", meas = "mean") %>% 
            read_fs_table
            }
}

Run the code above in your browser using DataLab