data(iris)
x <- subset(iris, select = -Species)
y <- iris$Species
## generate data list by dat.sel
iris.pw <- dat.sel(x,y,choices=NULL)
names(iris.pw)
pca.p <- pca_plot_wrap(iris.pw, ep=2)
pca.p[[1]] ## visualised by PCA
pca.p[[2]] ## plot PCA variables
pca.p[[3]] ## matrix of PCA variables
mds.p <- mds_plot_wrap(iris.pw)
mds.p
pls.p <- pls_plot_wrap(iris.pw)
pls.p[[1]]
pls.p[[2]]
pls.p[[3]]
lda.p <- lda_plot_wrap.1(iris.pw)
lda.p[[1]]
lda.p[[2]]
lda.p[[3]]
lda_plot_wrap(iris.pw)$lda.p
## only plot iris data
ph <- pca_plot_wrap(list(list(dat=x, cls=y)))$pca.p
## Not given data names
ph
update(ph, strip=FALSE) ## strip is an argument of lattice
tmp <- list(iris.dat=list(dat=x, cls=y))
pca_plot_wrap(tmp)$pca.p
pca_plot_wrap(tmp,strip=FALSE)$pca.p
pls_plot_wrap(tmp,strip=FALSE)$pls.p
lda_plot_wrap(tmp,strip=FALSE)$lda.p
data(abr1)
cls <- factor(abr1$fact$class)
dat <- preproc(abr1$pos, method="log")
## pair-wise data set
dat.pw <- dat.sel(dat, cls,choices=c("2","3","4"))
## add mult-class
idx <- grep("2|3|4",cls)
cls.234 <- factor(cls[idx])
dat.234 <- dat[idx,,drop = FALSE]
## combine all
dat.tmp <- c(dat.pw,
"2~3~4"=list(list(dat=dat.234,cls=cls.234)),
all=list(list(dat=dat, cls=cls)))
## PCA
ph <- pca_plot_wrap(dat.tmp, title="abr1", par.strip.text = list(cex=0.75),
scales=list(cex =.75,relation="free"), ep=2)
## See function grpplot for usage of ep.
ph[[1]]
ph[[2]]
##PLSDA
ph <- pls_plot_wrap(dat.tmp, title="abr1", par.strip.text = list(cex=0.75),
scales=list(cex =.75,relation="free"), ep=2)
ph[[1]]
ph[[2]]
## PCADA
ph <- lda_plot_wrap(dat.tmp, title="abr1", par.strip.text = list(cex=0.75),
scales=list(cex =.75,relation="free"))
ph[[1]]
ph[[2]]
Run the code above in your browser using DataLab