tongue.ssanova: Fit ssanova to groups of tongue splines

Description Usage Arguments Value Examples

View source: R/ssanova_plots.R

Description

Fit ssanova to groups of tongue splines

Usage

1
2
tongue.ssanova(tonguedat, theformula = Y ~ X, labels, weight = NULL,
  individual = FALSE)

Arguments

tonguedat

- the tongue data, usually with emu.track and a cut option

labels

- the labels used to define grouped splines

individual

- return all labels (including repeats), if true possibly good for debugging.

Value

a data frame with smoothed values and CI suitable for plotting with ggplot2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
plotoptions <- list(
 scale_x_continuous(breaks=seq(from=-50,to=50,by=20)),
  scale_y_continuous(breaks=seq(from=-40, to=30,by=20))
  )
  
gg <- tongue.ssanova(tongue.data.cut_0.5, labs.segs)
ggplot(gg, aes(x=X, y=Y, group=orig.tag, colour=orig.tag)) + 
geom_path() + geom_smooth(aes(ymin=Y-CI, ymax=Y+CI), stat='identity') +
 coord_fixed() + theme_bw()
 
g0 <- tongue.ssanova(tongue.data.cut_0.0, labs.segs)
g1 <- tongue.ssanova(tongue.data.cut_0.5, labs.segs)
g2 <- tongue.ssanova(tongue.data.cut_1.0, labs.segs)

gall <- combineCuts(g0, g1, g2, cutnames=c("start", "middle", "end"))
ggplot(gall, aes(x=X, y=Y, group=interaction(orig.tag,timepoint), colour=orig.tag)) + 
geom_path() + geom_smooth(aes(ymin=Y-CI, ymax=Y+CI), stat='identity') +
 coord_fixed() + theme_bw() + plotoptions
 
 
ggplot(gall, aes(x=X, y=Y, group=interaction(orig.tag,timepoint), colour=timepoint)) + 
geom_path() + geom_smooth(aes(ymin=Y-CI, ymax=Y+CI), stat='identity') +
 facet_wrap(~orig.tag) + coord_fixed() + theme_bw() + plotoptions 
 

## End(Not run)

richardbeare/ultRa documentation built on May 27, 2019, 7:58 a.m.