dosreislab / mcmc3r

mcmc3r: an R package for MCMCTree
MIT License
2 stars 2 forks source link

Morpho #5

Closed sabifo4 closed 6 years ago

sabifo4 commented 6 years ago

FUNCTIONS IN R

Finished main functions inside morpho.R:

Added extra functions we discussed that would be good to have:

Functions array2matrix and matrix2array were already defined, have not been implemented.

NEW DATA FILES

Directory data

All rda files that have been generated to be called in the examples sections and can be used by the user to test the functions.

Directory data-raw

All R files describing the process followed to generate the rda files from raw data so the users can understand how to process their raw data.

Directory inst

Updated raw data for canids (19 specimens) and Vulpes vulpes (21, remember Vulpes_5 was deleted as it caused problem). Added a REFERENCES.bib file so all references that are going to be cited in the functions can be added there and then called in the roxygen comments.

Directory man

Files automatically generated by roxygen2. Contains manual for all the new created objects

Directory R

All R files to describe the objects saved in the data directory. The updated morpho.R is also here.

ADDED TESTS

The directory tests has been created with the tests I have thought that are interesting to have for the functions in morpho.R.

ADDED LINES IN DESCRIPTION

I added lines from 12 to 18 in the DESCRIPTION file. These lines define what needs to be imported (only ape and Rdpack, the latter is for references), suggested (testthat, for the tests), RdMacros (apparently Rdpack needs to load a macro), and dependency (I added R (>= 3.3.2), you can modify this if you want to).

CONSIDERATION FOR NAMESPACE

The NAMESPACE file in your morpho branch was generated with roxygen so I cannot modify it. I have the following lines in mine (good to know in case there is a problem when installing the package with the new functions)

exportPattern("^[[:alpha:]]+")
importFrom("utils", "write.table", "read.csv")
importFrom("stats", "var", "cov", "rnorm", "cor")
importFrom(Rdpack,reprompt)

TO-DO

I am now working on vignettes, so people can do some examples with the rda objects already created. Hope you find this useful!