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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/eaf.R
\name{eafs}
\alias{eafs}
\title{Exact computation of the EAF in 2D or 3D}
\usage{
eafs(points, sets, groups = NULL, percentiles = NULL)
}
\arguments{
\item{points}{Either a matrix or a data frame of numerical values, where
each row gives the coordinates of a point.}
\item{sets}{A vector indicating which set each point belongs to.}
\item{groups}{Indicates that the EAF must be computed separately for data
belonging to different groups.}
\item{percentiles}{(\code{numeric()}) Vector indicating which percentiles are computed.
\code{NULL} computes all.}
}
\value{
A data frame (\code{data.frame}) containing the exact representation
of EAF. The last column gives the percentile that corresponds to each
point. If groups is not \code{NULL}, then an additional column
indicates to which group the point belongs.
}
\description{
This function computes the EAF given a set of 2D or 3D points and a vector \code{set}
that indicates to which set each point belongs.
}
\note{
There are several examples of data sets in \code{system.file(package="eaf","extdata")}. The current implementation only supports two and three dimensional points.
}
\examples{
extdata_path <- system.file(package="eaf", "extdata")
x <- read_datasets(file.path(extdata_path, "example1_dat"))
# Compute full EAF
str(eafs(x[,1:2], x[,3]))
# Compute only best, median and worst
str(eafs(x[,1:2], x[,3], percentiles = c(0, 50, 100)))
x <- read_datasets(file.path(extdata_path, "spherical-250-10-3d.txt"))
y <- read_datasets(file.path(extdata_path, "uniform-250-10-3d.txt"))
x <- rbind(data.frame(x, groups = "spherical"),
data.frame(y, groups = "uniform"))
# Compute only median separately for each group
z <- eafs(x[,1:3], sets = x[,4], groups = x[,5], percentiles = 50)
str(z)
# library(plotly)
# plot_ly(z, x = ~X1, y = ~X2, z = ~X3, color = ~groups,
# colors = c('#BF382A', '#0C4B8E')) \%>\% add_markers()
}
\references{
\insertRef{Grunert01}{eaf}
\insertRef{FonGueLopPaq2011emo}{eaf}
}
\seealso{
\code{\link[=read_datasets]{read_datasets()}}
}
\author{
Manuel López-Ibáñez
}
\concept{eaf}
|