View source: R/project_points.R
project_points | R Documentation |
projects data points onto the curve defined by the model function
project_points(x, y, xylim, best.model, plot = door_default_values("plot"),
points_cex = door_default_values("points.cex"),
title = door_default_values("title"), ...)
x, y |
numeric vectors of data values, coordinate vectors of points to
plot, the coordinates can contain |
xylim |
numeric vectors, x, y limits of the plot. |
best.model |
a list, containing the parameters, function, inverse function, Leibniz's notation for distance calculation and MD value. if missing, the best model will be generated automatically. |
plot |
logical, If |
points_cex |
a numerical value, giving the magnification level of symbols relative to the default size. |
title |
logical, If |
... |
further graphical parameters |
For internal use in the merging process (see also
model_response
). The model function is choosen by
calculate_model
. project_points
then projects the
data points from the datasets to be merged onto the curve defined by the
model function. It computes the closest distance from a data point to a point
on the curve by numerical optimisation.
A list with two data frames "double.observations" and "single.observations"
is returned, which give the coordinates of double observations (defined as
(x,y)) and coordinates of single observation (defined as (x,NA) or (NA,y)).
Both data frames contain seven columns: "ID" indicating the original position
of data x and y, "x", "y" indicating the coordinate of observation, "X", "Y"
indicating the coordinate of projected point on the function, "distance"
indicating the distances between (xmin, f(xmin))
and all points on the
functional line, "NDR" indicating the normalized distances across all the
distance values.
Shouwen Ma <shouwen.ma@uni-konstanz.de>
calculate_model
, optimize
,
integrate
# load data
library(DoOR.data)
data(Or23a)
# normalize two example data sets
x <- door_norm(Or23a[,'Hallem.2004.EN'])
y <- door_norm(Or23a[,'Hallem.2006.EN'])
# find the best fitting function and project the remaining points (measured
# only in one of the data sets) onto the fit.
project_points(x = x, y = y, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.