Files removed:
man/coords.*.Rd, man/write.phylo.Rd --> Man files with old coordinates and man file with old main function
inst/extdata/Triturus_and_Calotriton.csv --> Old data set used as an example
R/coords.*.R --> R files with old coordinates
data/coords.*.rda --> Rda files with old coordinates
Files added:
man/ : New man files for new functions (array2matrix.Rd, matrix2array.Rd, write.morpho.Rd), files with new coordinates for the examples (canids19x29.array.Rd, canids19x29.matrix.Rd, canids19x29.raw.Rd, vulpes21x29.array.Rd, vulpes21x29.matrix.Rd, vulpes21x29.raw.Rd), file with R correlation matrix for the examples (R.Rd), file with array with pop variances for the examples (var.fx.Rd).
R/: New R files for new functions (array2matrix.R, matrix2array.R, write.morpho.R), files with new coordinates for the examples (canids19x29.array.R, canids19x29.matrix.R, canids19x29.raw.R, vulpes21x29.array.R, vulpes21x29.matrix.R, vulpes21x29.R.raw.R), file with R correlation matrix for the examples (R.R), file with array with pop variances for the examples (var.fx.R).
inst/extdata: Raw data with new coordinates (canids19x29.csv, vulpes21x29.csv).
data: New rda files for new functions (array2matrix.rda, matrix2array.rda, write.morpho.rda), files with new coordinates for the examples (canids19x29.array.rda, canids19x29.matrix.rda, canids19x29.raw.rda, vulpes21x29.array.rda, vulpes21x29.matrix.rda, vulpes21x29.R.raw.rda), file with R correlation matrix for the examples (R.rda), file with array with pop variances for the examples (var.fx.rda).
data-raw: R files explaining how I generated all the files in data/. This directory is ignored when building the package (add ^data-raw$ in .Rbuildignore) and it is meant to let the users know how the rda data was prepared in case they have doubts.
NOTES:
I added importFrom("stats", "var") in the NAMESPACE file to avoid warning when devtools::check().
The file morpho.R now contains three functions: write.morpho(), array2matrix(), and matrix2array(). The former is the one that generates the alignment file in phylip format. Now, this function also scales the data if a vector with variances is provided (parameter "popvar") and transforms the data if a correlation matrix is provided (parameter "R") applying either the eigendecomposition (parameter method = "eigen") or the Cholesky decomposition (parameter method = "chol"). It takes also a new argument to write the name of the output file (parameter "filename").
The function array2matrix() takes an array of format p x k x n ('p' landmark points of 'n' specimens in 'k' dimension landmarks) and transforms it into a matrix with 'n' rows and 'p' columns. This function is used inside write.morpho() when flattening a 3D array, if the user provides a 3D array as argument for parameter "proc".
The function matrix2array() takes a matrix of format n x p ('n' rows for 'n' specimens and 'p' columns for 'p' coordinates) and transforms it into an array of format p x k x n ('k' is the dimension of the landmark points, 3D or 2D).
Changes:
Files removed: man/coords.*.Rd, man/write.phylo.Rd --> Man files with old coordinates and man file with old main function inst/extdata/Triturus_and_Calotriton.csv --> Old data set used as an example R/coords.*.R --> R files with old coordinates data/coords.*.rda --> Rda files with old coordinates
Files added: man/ : New man files for new functions (array2matrix.Rd, matrix2array.Rd, write.morpho.Rd), files with new coordinates for the examples (canids19x29.array.Rd, canids19x29.matrix.Rd, canids19x29.raw.Rd, vulpes21x29.array.Rd, vulpes21x29.matrix.Rd, vulpes21x29.raw.Rd), file with R correlation matrix for the examples (R.Rd), file with array with pop variances for the examples (var.fx.Rd). R/: New R files for new functions (array2matrix.R, matrix2array.R, write.morpho.R), files with new coordinates for the examples (canids19x29.array.R, canids19x29.matrix.R, canids19x29.raw.R, vulpes21x29.array.R, vulpes21x29.matrix.R, vulpes21x29.R.raw.R), file with R correlation matrix for the examples (R.R), file with array with pop variances for the examples (var.fx.R). inst/extdata: Raw data with new coordinates (canids19x29.csv, vulpes21x29.csv). data: New rda files for new functions (array2matrix.rda, matrix2array.rda, write.morpho.rda), files with new coordinates for the examples (canids19x29.array.rda, canids19x29.matrix.rda, canids19x29.raw.rda, vulpes21x29.array.rda, vulpes21x29.matrix.rda, vulpes21x29.R.raw.rda), file with R correlation matrix for the examples (R.rda), file with array with pop variances for the examples (var.fx.rda). data-raw: R files explaining how I generated all the files in data/. This directory is ignored when building the package (add ^data-raw$ in .Rbuildignore) and it is meant to let the users know how the rda data was prepared in case they have doubts.
NOTES: I added importFrom("stats", "var") in the NAMESPACE file to avoid warning when devtools::check().
The file morpho.R now contains three functions: write.morpho(), array2matrix(), and matrix2array(). The former is the one that generates the alignment file in phylip format. Now, this function also scales the data if a vector with variances is provided (parameter "popvar") and transforms the data if a correlation matrix is provided (parameter "R") applying either the eigendecomposition (parameter method = "eigen") or the Cholesky decomposition (parameter method = "chol"). It takes also a new argument to write the name of the output file (parameter "filename").
The function array2matrix() takes an array of format p x k x n ('p' landmark points of 'n' specimens in 'k' dimension landmarks) and transforms it into a matrix with 'n' rows and 'p' columns. This function is used inside write.morpho() when flattening a 3D array, if the user provides a 3D array as argument for parameter "proc".
The function matrix2array() takes a matrix of format n x p ('n' rows for 'n' specimens and 'p' columns for 'p' coordinates) and transforms it into an array of format p x k x n ('k' is the dimension of the landmark points, 3D or 2D).