Displaying 2 results from an estimated 2 matches for "amylase".
2012 Mar 19
2
by output into data frame
I could do this in various hacky ways, but what's the right way?
I have a nice application of the by function, which does what I want. The output looks like this:
> auc_stress
lab.samples.stress$subid: 2
cortisol amylase
1 919.05 6834.8
---------------------------------------------------------------------------------------------------------------------------
lab.samples.stress$subid: 3
cortisol amylase
11 728.25 24422.05
etc.
What I want is a data frame roughly like this:
subid cortisol.auc amylase.a...
2012 Apr 23
2
plot function creating bars instead of lines
...is meant to plot a separate line for each subject for each
challenge*************
for (subj in unique(lab.samples$subid)) {
#par(new=T)
plot.new()
par(mfrow=c(2,1))
par(mfg=c(1,1))
plot(data=lab.samples, subset=(subid==subj), cortisol ~ Sample, type='n',
main=paste('Cortisol and Amylase for subject ', as.character(subj)))
for ( t in unique(subset(lab.samples,subid==subj)$challenge) ) {
par(mfg=c(1,1))
lines(data=lab.samples, subset=(subid==subj & challenge==t),
cortisol ~ Sample, type='b', pch=as.character(t), col=rainbow(2)[t])
}
par(mfg=c(2,1))
plot(...