knitr::opts_chunk$set(echo = TRUE)
evoregions
the function evoregions
need to be revised with care. It was working well, but I implement a set of changes in the behavior of the function.
Some changes are:
the cleaning of tree
and comm
inside the function was removed. Now the code picante::match.phylo.comm(phy, comm)
only assure if the order of the names is correct. If any species is misssing in tree
or comm
the function stop
s and inform the user to use picante::match.phylo.comm
before evoregions
. This makes sure that the function will not delete anything, and the output could be easaly merged with the initial data.
The output was dramatically changed:
1) the PCPS results was organized in a single list, with i) PCPS vectors, ii) proportinal explanation of the vectors, iii) the threshold value to used to select the number of PCPS axis in the cluster step.
2) I changed the output of the Cluster_Evoregions
list to return only the vector with the groups. I think the other results are not necessarry.
3) I removed the Matrix_P
output. I think this is not a important result, since it is only used to calculate PCPS vectors.
4) also removed the cumulative explanation of the axis used in the cluster step. This could be get by the output in the current PCPS list.
Also, I have some sugestions to be implemented:\
* The argument max.n.clust.method
should be removed. It only provides one option, and do not need an argument. In addition, I think that this functionality shouldn't be within the evoregions
function. It should be provided as sepated function to find the maximun number of cluster. In the evoregions
function, we can set the max.n.clust
with a default number (i think 10 or 15 is ok) and explain what functions could be used to define this number.
afilliation.evoreg
Not working well.
The function calculates the affiliation without error (using evoregion class) but the order of the sites in the output differs from the input. As this function is intented to be used to map the zones of transition, this mismatch in the output generates a map without recognizable pattern.
Then, I think this function need to be reviewed e re-written.
some issues in this function:
[x] line 21: this object phylo_regionalization
is not in the argument list;
[x] line 40 (and 34) - the distance matrix is calculated from all PCPS axis. I think it should be only the same as used in the regionalization. Maybe the PCPS output in the evoregion
function should return only the axis used in adegenet::find.cluster
.
[x] argument method
have not being used with phylregion
class. - this argument was removed
some suggestion:
I think the evo.classification
could be transformed into two new arguments. phylo.comp
, regions
. The first a matrix to be computed the distance among sites, the second the regions provided by the phylogenetic classification.
I allows to remove the necessity of predict the behaviour of each class (phyloregion
or evoregion
)
tipranges_to_BioGeoBEARS
Function included in the package to save a phyllip file as required by BioGeoBEARS
tipranges_to_BioGeoBEARS
ain't working[x] remove 'DivB_metrics.R'
[x] change 'Herodotools/inst/extdata/resDEC_akodon.rds' to an '.RData' file. Or
Add dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'Herodotools/inst/extdata/resDEC_akodon.rds'
[ ] from which package does the function .node.desc
belong to? [line 82 of 'function_model_based_diversificationJetz.R']. it must be included in Imports/Suggests of the DESCRIPTION file or be refered as pkg::.node.desc
[x] keep coherent pattern for function names. I suggest use always "_" instead of ".". For example, find_max_nclust()
instead of find.max.nclust()
[x] ggplot2, sf and rcartocolor were removed from @import in theplot_ada()
. They are suggested packages in DECRIPTION file.
[x] function GridFilter()
is based on rgeos
[Please note that rgeos will be retired by the end of 2023, plan transition to sf functions using GEOS at your earliest convenience]. I suggest to remove the function if it has no clear utility. If the function will kept in the package run the following code in the console:
use_this::use_package("sp", "suggest") use_this::use_package("rgeos", "suggest") use_this::use_package("terra", "suggest")
In addition, put the following code in line 17 of the 'function_gridfilter.R' file:
pkg_req <- c("rgeos", "sp", "raster", "terra") for(pkg in pkg_req) { if (!requireNamespace(pkg, quietly = TRUE)) { stop( paste0("Package '", pkg, "' must be installed to use this function."), call. = FALSE ) } }
[x] add documentation for argument age.no.ancestor
in 'function_age_arrival.R'.
[x] max.n.clust.method
argument was removed from evoregions()
. The behavior of max.n.clust = NULL
argument was maintained.
[ ] from which package does the function .node.desc
belong to? [line 82 of 'function_model_based_diversificationJetz.R']. it must be included in Imports/Suggests of the DESCRIPTION file or be refered as pkg::.node.desc
- I have no idea where this function comes from
[X] Find a better way to represent the percentage of contribution of dispersal events in a map
[X] Describe dispersal_from function
[x] build a toy example -> I used the same toy example that I made for the Tyrannidae paper
[x] fix website (working just locally but not on the server) -> Ive fixed it by changing the folder used to build the site
[x] add examples to the functions -> working in progress
[ ] when possible, add the tests made with the toy_example to the testthat.R file.
[ ] suggestion: change the vignette to article. create an article with use_article()
and copy/paste the vignette to there. When the package is built, the article is not biult, but the vignette is.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.