curveEPE | R Documentation |
curveEPE
is used to draw the Preston curve that is produced by the explicit Preston equation.
curveEPE(P, np = 5000, simpver = NULL,
fig.opt = FALSE, deform.fun = NULL, Par = NULL,
xlim = NULL, ylim = NULL, unit = NULL, main="")
P |
the three location parameters and the parameters of the explicit Preston equation or one of its simplified versions. |
np |
the number of data points on the Preston curve. |
simpver |
an optional argument to use the simplfied version of the explicit Preston equation. |
fig.opt |
an optional argument to draw the Preston curve. |
deform.fun |
the deformation function used to describe the deviation from a theoretical Preston curve. |
Par |
the parameter(s) of the deformation function. |
xlim |
the range of the |
ylim |
the range of the |
unit |
the units of the |
main |
the main title of the figure. |
The first three elements of P
are location parameters. The first two are the planar coordinates of the transferred origin,
and the third is the angle between the major axis of the curve and the x
-axis. Here, the major axis is a straight line through
the two ends of an egg's profile (i.e., the mid-line of the egg's profile). The other arguments in P
(except these first three location parameters), and simpver
should correspond to those of P
in EPE
.
deform.fun
should take the form as: deform.fun <- function(Par, z){...}
, where z
is
a two-dimensional matrix related to the x
and y
values.
And the return value of deform.fun
should be a list
with two variables x
and y
.
x |
the |
y |
the |
When the rotation angle is zero (i.e., the third element in P
is zero), np
data points
are distributed counterclockwise on the Preston curve from the rightmost end of the egg's profile to itself.
Peijian Shi pjshi@njfu.edu.cn, Johan Gielis johan.gielis@uantwerpen.be, Brady K. Quinn Brady.Quinn@dfo-mpo.gc.ca.
Preston, F.W. (1953) The shapes of birds' eggs. The Auk 70, 160-
182.
Shi, P., Chen, L., Quinn, B.K., Yu, K., Miao, Q., Guo, X., Lian, M., Gielis, J., Niklas, K.J. (2023)
A simple way to calculate the volume and surface area of avian eggs.
Annals of the New York Academy of Sciences 1524, 118-
131. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/nyas.15000")}
Shi, P., Gielis, J., Quinn, B.K., Niklas, K.J., Ratkowsky, D.A., Schrader, J., Ruan, H.,
Wang, L., Niinemets, Ü. (2022) 'biogeom': An R package for simulating and fitting natural
shapes. Annals of the New York Academy of Sciences 1516, 123-
134. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/nyas.14862")}
Shi, P., Wang, L., Quinn, B.K., Gielis, J. (2023) A new program to estimate the parameters of Preston's equation, a general formula for describing the egg shape of birds. Symmetry 15, 231. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3390/sym15010231")}
Todd, P.H., Smart, I.H.M. (1984) The shape of birds' eggs. Journal of Theoretical Biology
106, 239-
243. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0022-5193(84)90021-3")}
EPE
, fitEPE
, lmPE
, PE
, TSE
Para1 <- c(0, 0, 0, 10, 6, 0.325, -0.0415)
curveEPE(P=Para1, simpver=1, fig.opt=TRUE)
Para2 <- c(0, 0, pi, 10, 6, -0.325, -0.0415)
curveEPE(P=Para2, simpver=1, fig.opt=TRUE)
Para3 <- c(0, 0, 0, 10, 6, 0.325, -0.0415, 0.2)
curveEPE(P=Para3, simpver=NULL, fig.opt=TRUE)
Para4 <- c(0, 0, pi, 10, 6, -0.325, -0.0415, 0.2)
curveEPE(P=Para4, simpver=NULL, fig.opt=TRUE)
Para5 <- c(0, 0, pi/4, 10, 6, 0.325, -0.0415)
curveEPE(P=Para5, simpver=1,
fig.opt=TRUE, main="A rotated egg shape")
# There is an example that introduces a deformation function in the egg-shape equation
myfun <- function(Par, z){
x <- z[,1]
y <- z[,2]
k1 <- Par[1]
k2 <- Par[2]
y <- y - k1*(y+k2)^2
list(x=x, y=y)
}
deform.op <- curveEPE(P=Para1, np=5000, simpver=1,
fig.opt=TRUE, deform.fun=myfun, Par=c(0.05, 8))
graphics.off()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.