foruse | R Documentation |
Provides a matrix of all observations with the reference observation identification best used to represent it, followed by the distance.
foruse(object,kth=NULL,method="kth",targetsOnly=FALSE)
object |
an object created by |
kth |
when |
method |
the method used to select references to represent observations,
as follows: |
targetsOnly |
when is TRUE, reporting of references is not done. |
Nicholas L. Crookston ncrookston.fs@gmail.com
Andrew O. Finley finleya@msu.edu
require(yaImpute) data(iris) # form some test data set.seed(1234) refs=sample(rownames(iris),50) x <- iris[,1:3] # Sepal.Length Sepal.Width Petal.Length y <- iris[refs,4:5] # Petal.Width Species # build a yai object using mahalanobis mal <- yai(x=x,y=y,method="mahalanobis",k=3) foruse(mal) # for references, use is equal to the rowname foruse(mal,kth=1) # for references, use is an row to the kth reference. # get all the choices: cbind(foruse(mal),foruse(mal,kth=1),foruse(mal,kth=2),foruse(mal,kth=3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.