Skip to content
/ macam Public

macam: A collection of miscellaneous R functions for ecology

License

Notifications You must be signed in to change notification settings

ong8181/macam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macam: A collection of miscellaneous R functions for ecology

DOI

This package contains a collection of miscellaneous functions for ecological studies.

License

See LICENSE.

Installation

You can install the development version of macam from GitHub with:

#install.packages("remotes")
remotes::install_github("ong8181/macam")

# Or build_vignettes = TRUE to install with vignettes
remotes::install_github("ong8181/macam", build_vignettes = TRUE, force = TRUE)

Functions

Type ?macam::xxxxx() for detail. Also please check browseVignette("macam").

File/directory handling

  • outdir_create(): Create output directory.
  • save_workspace(): Save workspace.
  • save_session_info(): Save session information.

Sequence analysis

  • AllOrients(): List up all orientations of primer sequence (from DADA2 tutrial).
  • PrimerHits(): Count the number of primer hits (from DADA2 tutrial)
  • cov_info(): Get coverage and diversity information of a phyloseq object using iNEXT package.
  • rarefy_even_coverage(): Perform coverage-based rarefaction.
  • plot_rarefy(): Visualize results of coverage-based rarefaction.
  • taxa_name_bundle(): Bundle taxa names in phyloseq object for visualization purpose.
  • assign_ps_barcol(): Assign colors to the barplot generated by phyloseq::plot_bar().

Time series analysis

  • s_map_rgl(): Perform the regularized S-map in Cenci et al. (2019). A wrapper function of extended_lnlp().
  • extended_lnlp(): A generalized function for the regularized S-map. For the multivariate S-map, please use this function.
  • twin_surrogate_cpp(): Generate twin surrogate time series from an original time series (see Thiel et al. 2006).
  • uic_across(): Perform UIC across columns (for the MDR S-map) (beta version).
  • make_block_mvd(): Generate data.frame for the calculation of multiview distance (for the MDR S-map) (beta version).
  • compute_mvd(): Compute multiview distance (for the MDR S-map) (beta version).
  • s_map_mdr(): Perform the MDR S-map in Chang et al. (2021) (beta version).
  • s_map_mdr_all(): A convenient all-in-one wrapper function for the MDR S-map. To fine-tune parameters, use step-by-step functions such as compute_mvd() etc (beta version).

ggplot2 functions

  • label_10_to_power(): Convert a numeric variable to a scientific notation (e.g., 1500 will be $1.5 \times 10^3$)

data

  • data_4sp: Demo time series data for time series analysis. Data is from Ushio et al. (2018).
  • asv_sheet: A demo ASV sheet for sequence analysis. Data is from Ushio (2019).
  • sample_sheet: A demo sample sheet for sequence analysis. Data is from Ushio (2019).
  • tax_sheet: A demo taxa sheet for sequence analysis. Data is from Ushio (2019).

References

About

macam: A collection of miscellaneous R functions for ecology

Resources

License

Stars

Watchers

Forks

Packages

No packages published