## Not run:
# require(prospectr)
#
# data(NIRsoil)
#
# Xu <- NIRsoil$spc[!as.logical(NIRsoil$train),]
# Yu <- NIRsoil$CEC[!as.logical(NIRsoil$train)]
# Yr <- NIRsoil$CEC[as.logical(NIRsoil$train)]
# Xr <- NIRsoil$spc[as.logical(NIRsoil$train),]
#
# Xu <- Xu[!is.na(Yu),]
# Yu <- Yu[!is.na(Yu)]
#
# Xr <- Xr[!is.na(Yr),]
# Yr <- Yr[!is.na(Yr)]
#
# # Computation of the orthogonal dissimilarity matrix using the
# # default parameters
# ex1 <- orthoDiss(Xr = Xr, X2 = Xu)
#
# # Computation of a principal component dissimilarity matrix using
# # the "opc" method for the selection of the principal components
# ex2 <- orthoDiss(Xr = Xr, X2 = Xu,
# Yr = Yr,
# pcSelection = list("opc", 40),
# method = "pca",
# return.all = TRUE)
#
# # Computation of a partial least squares (PLS) dissimilarity
# # matrix using the "opc" method for the selection of the PLS
# # components
# ex3 <- orthoDiss(Xr = Xr, X2 = Xu,
# Yr = Yr,
# pcSelection = list("opc", 40),
# method = "pls")
#
# # Computation of a partial least squares (PLS) local dissimilarity
# # matrix using the "opc" method for the selection of the PLS
# # components
# ex4 <- orthoDiss(Xr = Xr, X2 = Xu,
# Yr = Yr,
# pcSelection = list("opc", 40),
# method = "pls",
# local = TRUE,
# k0 = 200)
# ## End(Not run)
Run the code above in your browser using DataLab