generate_y: Generate simulated nifti data examples

Description Usage Arguments Value Examples

View source: R/generate_y.R

Description

Generate simulated nifti data examples

Usage

1
2
generate_y(npergroup = 10, type = c("xs", "long"), saveinfti = FALSE,
  outfile = "")

Arguments

npergroup

sample size in each of the two groups. There are 2*n rows in the simulated data.

type

specify study type. 'xs': Cross-sectional; 'long':longitudinal.

saveinfti

if saveinfti = TRUE, save result to NIfTI file.

outfile

the name or connection of the file where the NIfTI file is saved to.

Value

if cross-sectional, an array of dim c(64, 64, 32, 2*npergroup); if longitudinal, a list of 2 such arrays for basline and follow-up.

Examples

1
2
3
4
5
6
7
8
library(neurorct)
# cross-sectional data
xs_data = generate_y(35, type = 'xs')

# longitudinal data
long_data = generate_y(20, type = 'long')
bl = long_data$baseline
fu = long_data$follow_up

seonjoo/neurorct documentation built on May 7, 2020, 3:18 a.m.