## Make test data available
data(sind)
attach(sind)
sind.mat <- as.matrix(sind[, -c(1:3)])
## Ensure all data are in the same units (mg/kg)
sind.mat2open <- sind.mat
sind.mat2open[, 2] <- sind.mat2open[, 2] * 10000
## Generate gx.robmva object after an clr transform using prior weights
sind.wts <- rep(1, 25)
## Set weights of all 6 high weighted sums, truly anomalous, individuals
## to zero
sind.wts[c(9, 12, 13, 15, 16, 21)] <- 0
sind.save.rob.clr <- gx.robmva(clr(sind.mat2open), wts = sind.wts)
## Display saved object with alternate main titles
gx.rqpca.screeplot(sind.save.rob.clr,
main = "Howarth & Sinding-Larsen
Stream Sediments, clr Transformed Data",
cex.main = 0.8)
gx.rqpca.plot(sind.save.rob.clr,
main = "Howarth & Sinding-Larsen
Stream Sediments, clr Transformed Data",
cex.main = 0.8)
gx.md.plot(sind.save.rob.clr,
main = "Howarth & Sinding-Larsen
Stream Sediments
clr Transformed Data",
cex.main = 0.8, cex.lab = 0.9)
gx.md.print(cbind(sind.save.rob.clr$md,sind.save.rob.clr$ppm,
ID, Zn, Cu, Cd, Fe, Mn), pcut = 0.5)
## Generate gx.robmva object after an ilr transform
## ** Function gx.robmva.closed should be used **
## ** This is for demonstration only **
sind.save.rob.ilr <- gx.robmva(ilr(sind.mat2open))
## Display saved object with alternate main titles
gx.rqpca.screeplot(sind.save.rob.ilr,
main = "Howarth & Sinding-Larsen
Stream Sediments, ilr Transformed Data",
cex.main = 0.8)
gx.rqpca.plot(sind.save.rob.ilr,
main = "Howarth & Sinding-Larsen
Stream Sediments, ilr Transformed Data",
cex.main = 0.8)
gx.md.plot(sind.save.rob.ilr,
main = "Howarth & Sinding-Larsen
Stream Sediments
ilr Transformed Data",
cex.main = 0.8, cex.lab = 0.9)
gx.md.print(cbind(sind.save.rob.ilr$md,sind.save.rob.ilr$ppm,
ID, Zn, Cu, Cd, Fe, Mn), pcut = 0.5)
## Clean-up and detach test data
rm(sind.mat)
rm(sind.mat2open)
rm(sind.wts)
rm(sind.save.rob.clr)
rm(sind.save.rob.ilr)
detach(sind)
Run the code above in your browser using DataLab