Description Usage Arguments Details Value Author(s) See Also Examples
Read in a tab-delimited text file containing power spectra and auxiliary information, i.e. subject, treatment and time variables.
1 2 3 | readSpectra(file, info = 1:3,
treatment = c("Control", "Low Dose", "Middle Dose", "High Dose"),
resolution = 1, end = 42900, nfreq = 36, ...)
|
file |
The name of the file. |
info |
Numeric indices of columns containing auxiliary information - the remaining columns are assumed to contain the power spectra. |
treatment |
A vector of levels for the treatment variable, assumed to be named "treatment" (case insensitive) - ignored if no such variable is found. |
resolution |
The desired resolution of frequencies, in Hz. Data read in at a higher resolution is aggregated. |
end |
The last time point to be included in the result - observations at further time points are dropped from the data. |
nfreq |
The number of frequencies to be included in the result (after any
aggregation specified by |
... |
Further arguments passed to |
Information variables that are read as character vectors are converted to
factors, using the levels passed to the treatment
argument for the
treatment variable (if found). Note these levels must match the original values
of the treatment variable, this argument simply specifies the ordering of the
levels.
A data frame containing the information variables with their original names and the matrix of spectra, named "spectra".
Heather Turner
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
## Read data in from tab-delimited text file
DATA <- readSpectra("Compound1.txt", info = 1:3,
treatment = c("Control", "Low Dose", "Middle Dose", "High Dose"),
resolution = 1, end = 42900, nfreq = 36)
## Use result directly in call to gslcca
result <- gslcca(spectra, "Double Exponential",
time=Time, subject = Rat,
treatment = Treatment, data = DATA,
separate = FALSE, global = FALSE,
subject.smooth = TRUE, pct.explained = 0.96)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.