Description Usage Arguments Details Value Author(s) References See Also Examples
This function partitions each row of a matrix into objects of a list.
1 | matrix2list(x)
|
x |
a matrix |
This function converts the landmark coordinate data into a format suitable as input for
anglePolygon
.
a list of objects; the number of objects is equal to the number of rows of x
;
each object is a vector of length equal to the number of columns of x
Tsung Fei Khang tfkhang@um.edu.my
Khang TF, Soo OYM, Tan WB, Lim LHS. (2016). Monogenean anchor morphometry: systematic value, phylogenetic signal, and evolution. PeerJ 4:e1668.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | data(ligophorus_tpsdata)
#Check right ventral anchor polygon of the first specimen
anglePolygon(matrix2list(ligophorus_tpsdata$bantingensis[[1]][1:11,]), degree=TRUE)
#Now check the rest
anglePolygon(matrix2list(ligophorus_tpsdata$bantingensis[[1]][12:22,]), degree=TRUE)
anglePolygon(matrix2list(ligophorus_tpsdata$bantingensis[[1]][23:33,]), degree=TRUE)
anglePolygon(matrix2list(ligophorus_tpsdata$bantingensis[[1]][34:44,]), degree=TRUE)
#A more efficient way of doing things
result <- mapply(function(k) {
anglePolygon(matrix2list(ligophorus_tpsdata$bantingensis[[1]][(11*(k-1)+1):(11*k),]),
degree=TRUE)}, k=1:4)
result_angle <- mapply(function(k) list(result[[2*k-1]]), k=1:4)
result_orientation <- mapply(function(k) list(result[[2*k]]), k=1:4)
names(result_angle) <- names(result_orientation) <- c("VR","VL","DR","DL")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.