plot.SCGLR: SCGLR generic plot

Description Usage Arguments Value Examples

View source: R/plot.r

Description

SCGLR generic plot

Usage

1
2
3
## S3 method for class 'SCGLR'
plot(x, ..., style = getOption("plot.SCGLR"),
  plane = c(1, 2))

Arguments

x

an object from SCGLR class.

...

optional arguments (see customize).

style

named list of values used to customize the plot (see customize)

plane

a size-2 vector (or comma separated string) indicating which components are plotted (eg: c(1,2) or "1,2").

Value

an object of class ggplot.

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
28
29
30
31
32
33
34
35
36
37
## Not run: 
library(SCGLR)

# load sample data
data(genus)

# get variable names from dataset
n <- names(genus)
ny <- n[grep("^gen",n)]    # Y <- names that begins with "gen"
nx <- n[-grep("^gen",n)]   # X <- remaining names

# remove "geology" and "surface" from nx
# as surface is offset and we want to use geology as additional covariate
nx <-nx[!nx%in%c("geology","surface")]

# build multivariate formula
# we also add "lat*lon" as computed covariate
form <- multivariateFormula(ny,c(nx,"I(lat*lon)"),c("geology"))

# define family
fam <- rep("poisson",length(ny))

genus.scglr <- scglr(formula=form,data = genus,family=fam, K=4,
 offset=genus$surface)

summary(genus.scglr)

barplot(genus.scglr)

plot(genus.scglr)

plot(genus.scglr, predictors=TRUE, factor=TRUE)

pairs(genus.scglr)


## End(Not run)

SCGLR documentation built on May 1, 2019, 8 p.m.