-
This function visualizes the temporal overlap between two species' activity patterns based on time-of-day data.
-It uses kernel density estimation to estimate activity densities and highlights areas of overlap between the two species.
+
This function visualizes species' activity patterns based on time-of-day data.
+It uses kernel density estimation to estimate activity density.
diff --git a/search.json b/search.json
index 8ff5d72..3da6599 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://stangandaho.github.io/maimer/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Stanislas Mahussi Gandaho. Author, maintainer. Laboratory Applied Ecology, University Abomey-Calavi, Benin (LAE/UAC)","code":""},{"path":"https://stangandaho.github.io/maimer/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Gandaho S (2025). maimer: Handle Camera Trap Data. R package version 0.2.0, https://stangandaho.github.io/maimer/.","code":"@Manual{, title = {maimer: Handle Camera Trap Data}, author = {Stanislas Mahussi Gandaho}, year = {2025}, note = {R package version 0.2.0}, url = {https://stangandaho.github.io/maimer/}, }"},{"path":[]},{"path":"https://stangandaho.github.io/maimer/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Handle Camera Trap Data","text":"Camera traps essential tool wildlife monitoring ecological research. generate vast amounts data require careful processing, cleaning, analysis extract meaningful insights. Researchers use camera trap data tasks species identification, biodiversity assessment, activity pattern analysis, occupancy modeling. However, handling analyzing data can complex time-consuming.","code":""},{"path":"https://stangandaho.github.io/maimer/index.html","id":"the-need-for-simplification","dir":"","previous_headings":"","what":"The Need for Simplification","title":"Handle Camera Trap Data","text":"Processing analyzing camera trap data R often requires multiple steps, cleaning raw data statistical modeling visualization. maimer R package addresses challenges providing modern, tidyverse-friendly workflow camera trap data analysis. Using tidy evaluation principles, enables users efficiently manipulate transform datasets. Additionally, integrates seamlessly ggplot2, allowing users generate highly customizable visualizations.","code":""},{"path":"https://stangandaho.github.io/maimer/index.html","id":"key-features-of-maimer","dir":"","previous_headings":"","what":"Key Features of maimer","title":"Handle Camera Trap Data","text":"Data Management & Standardization: Functions like mm_read(), mm_standardize(), mm_stack_df() help streamline data preparation. Manage media files: functions mm_remove_hs(), mm_get_hs(), mm_create_hs(), mm_app(), etc help read write image metadata. Data Cleaning & Validation: Ensure data integrity mm_check_name(), mm_check_location(). Flexible Data Transformation: Convert raw camera trap data formats suited different analyses (mm_to_community(), mm_to_occupancy(), mm_to_time()). Diversity Metrics: Calculate alpha beta diversity mm_alpha_diversity() mm_dissimilarity(), etc. Species Activity Overlap: Estimate visualize species overlap using mm_overlap_estimates(), mm_overlap_matrix(), mm_plot_overlap(). Temporal Analysis: Explore species activity shifts time mm_temporal_shift(). current complete list functions .","code":""},{"path":"https://stangandaho.github.io/maimer/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation:","title":"Handle Camera Trap Data","text":"can install ‘maimer’ directly GitHub using following command:","code":"# Install devtools package if you haven't already if(!'remotes' %in% rownames(installed.packages())){ install.packages(\"remotes\") } # Install maimer from GitHub remotes::install_github(\"stangandaho/maimer\")"},{"path":"https://stangandaho.github.io/maimer/index.html","id":"meta","dir":"","previous_headings":"","what":"Meta","title":"Handle Camera Trap Data","text":"welcome contributions including bug reports. License: MIT Get citation information maimer R citation(\"maimer\"). Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate bootstrap estimates of overlap — mm_bootstrap","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"bootstrap takes two sets times observations calculates bootstrap estimates chosen estimator overlap. Alternatively, bootstrap estimates can calculated 2-stage process: (1) create matrix bootstrap samples data set, using mm_resample(); (2) pass matrices mm_boot_estimates() obtain bootstrap estimates. vector bootstrap estimates can used produce confidence intervals mm_boot_CI().","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"","code":"mm_bootstrap( A, B, nb, smooth = TRUE, kmax = 3, adjust = NA, n_grid = 128, type = c(\"Dhat1\", \"Dhat4\", \"Dhat5\"), cores = 1 ) mm_resample(x, nb, smooth = TRUE, kmax = 3, adjust = 1, n_grid = 512) mm_boot_estimates( Amat, Bmat, kmax = 3, adjust = c(0.8, 1, 4), n_grid = 128, type = c(\"all\", \"Dhat1\", \"Dhat4\", \"Dhat5\"), cores = 1 )"},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"numeric vector time--day observations (radians) species . B numeric vector time--day observations (radians) species B. nb number bootstrap samples required smooth TRUE, smoothed bootstrap samples produced. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. n_grid integer specifying number grid points density estimation. Default 128. type name estimator use, \"\" produce three estimates. See mm_overlap_estimates() recommendations use. cores number cores use parallel processing. NA, one available cores used. Parallel processing may take longer serial processing bootstrap runs quickly. x numeric vector time--capture data radians, ie. [0, \\(2\\pi\\)] scale Amat, Bmat matrices resampled data species produced resample; see Value .","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"function mm_bootstrap() returns vector bootstrap estimates. estimation fails bootstrap sample, corresponding value NA. function mm_resample() returns numeric matrix column corresponding bootstrap sample. Times radians. may return matrix NAs smooth = TRUE bandwidth estimation fails. Function mm_boot_estimates type = \"\" returns numeric matrix three columns, one estimator overlap, otherwise vector bootstrap estimates.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"Ridout & Linkie (2009) Estimating overlap daily activity patterns camera trap data. Journal Agricultural, Biological, Environmental Statistics 14:322-337","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"Mike Meredith, Martin Ridout.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"","code":"# Generate random data for two species set.seed(42) species_A <- runif(100, 1.2, 2 * pi) species_B <- runif(100, 0.23, 2 * pi) est <- mm_overlap_estimates(species_A, species_B, type=\"Dhat4\") boots <- mm_bootstrap(species_A, species_B, 1000, type=\"Dhat4\", cores=1) mean(boots) #> [1] 0.8304592 hist(boots) mm_boot_CI(est, boots) #> lower upper #> norm 0.7975707 0.9708611 #> norm0 0.7706923 0.9439828 #> basic 0.8051838 0.9740576 #> basic0 0.7674959 0.9363697 #> perc 0.7406175 0.9094913 # alternatively: species_A_gen <- mm_resample(species_A, 1000) species_B_gen <- mm_resample(species_B, 1000) boots <- mm_boot_estimates(species_A_gen, species_B_gen, type=\"Dhat4\", cores=1) mean(boots) #> [1] 0.8338819"},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":null,"dir":"Reference","previous_headings":"","what":"Alpha diversity index — mm_alpha_diversity","title":"Alpha diversity index — mm_alpha_diversity","text":"Calculate index diversity within particular area ecosystem; usually expressed number species (.e., species richness) ecosystem.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alpha diversity index — mm_alpha_diversity","text":"","code":"mm_alpha_diversity( data, to_community = TRUE, index = \"shannon\", site_column, species_column, size_column = NULL, margin = 1 )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Alpha diversity index — mm_alpha_diversity","text":"data data frame containing species observation data. to_community Logical; TRUE, function first transforms data community matrix format sites rows species columns computing indices. Default TRUE. index character vector specifying diversity index calculate. Accepted values \"shannon\", \"simpson\", \"invsimpson\", \"evenness\", \"pielou\". Multiple indices can computed simultaneously providing vector. site_column column name data represents site location species recorded. species_column column(s) data representing species taxa. can single column name, range column indices (e.g., 2:5), selection helper (e.g., dplyr::starts_with(\"sp_\")). size_column (Optional) column data containing count abundance individuals per species. NULL, function assumes row represents one individual. margin integer specifying whether diversity calculations performed row (margin = 1) column (margin = 2). Default 1 (row-wise).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Alpha diversity index — mm_alpha_diversity","text":"tibble diversity index values site. first column corresponds site_column, followed one columns containing computed diversity indices, depending values specified index argument.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Alpha diversity index — mm_alpha_diversity","text":"Simpson diversity index Simpson (1949) introduced diversity index quantifies likelihood two randomly chosen individuals belonging species. probability increases diversity decreases; scenario diversity (one species), probability reaches 1. Simpson's Index computed using following formula: $$D = \\sum_{=1}^{S} \\left( \\frac{n_{}}{N} \\right)^2$$ \\(n_{}\\) number individuals species , N = total number individuals species, \\(\\frac{n_{}}{N} = pi\\) (proportion individuals species ), S = species richness. value Simpson’s D ranges 0 1, 0 representing infinite diversity 1 representing diversity, larger value D, lower diversity. reason, Simpson’s index often complement (1-D). Simpson's Dominance Index inverse Simpson's Index (\\(1/D\\)). Shannon-Weiner Diversity Index Shannon-Weiner Diversity Index measure diversity takes account species richness evenness, introduced Claude Shannon 1948. Commonly referred Shannon's Diversity Index, based concept uncertainty. instance, community low diversity, high level certainty (low uncertainty) identity randomly selected organism. Conversely, highly diverse community, uncertainty increases, making harder predict species randomly chosen organism belong (low certainty high uncertainty). $$H = -\\sum_{=1}^{S} p_{} * \\ln p_{}$$ \\(p_{}\\) = proportion individuals species , ln natural logarithm, S = species richness. value H ranges 0 Hmax. Hmax different community depends species richness. (Note: Shannon-Weiner often denoted H' ). Pielou Evenness diversity index Species evenness refers relative abundance species within environment. example, 40 foxes 1000 dogs, community uneven one species dominates. However, 40 foxes 42 dogs, community much even, species balanced number. degree evenness community can quantified using Pielou's evenness index (Pielou, 1966): $$J=\\frac{H}{H_{\\max }}$$ value J ranges 0 1. Higher values indicate higher levels evenness. maximum evenness, J = 1. J D can used measures species dominance (opposite diversity) community. Low J indicates 1 species dominate community.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Alpha diversity index — mm_alpha_diversity","text":"Pielou, E.C. (1966). measurement diversity different types biological collections. Journal Theoretical Biology, 13, pp. 131–144. doi:10.1016/0022-5193(66)90013-0. Simpson, E.H. (1949). Measurement diversity. Nature, 163, pp. 688. doi:10.1038/163688a0 Shannon, C.E. (1948). mathematical theory communication. Bell System Technical Journal, 27, pp. 379-423.https://doi.org/10.1002/j.1538-7305.1948.tb01338.x","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Alpha diversity index — mm_alpha_diversity","text":"","code":"cam_data <- read.csv(system.file('penessoulou_season1.csv', package = 'maimer')) # Transform data to community format and compute diversity indices alpha1 <- cam_data %>% mm_alpha_diversity( to_community = TRUE, size_column = number, site_column = camera, species_column = species, index = c(\"shannon\", \"evenness\", \"invsimpson\") ) # Alternative method using a manually transformed community matrix alpha2 <- cam_data %>% mm_to_community(site_column = camera, species_column = species, size_column = number, values_fill = 0) %>% mm_alpha_diversity( to_community = FALSE, site_column = camera, species_column = 2:11, index = c(\"shannon\", \"evenness\", \"invsimpson\") ) alpha2 #> # A tibble: 13 × 4 #> camera shannon evenness invsimpson #> #> 1 CAMERA 10 0.103 0.045 1.04 #> 2 CAMERA 3 0.974 0.423 2.46 #> 3 CAMERA 5 0.893 0.388 2.18 #> 4 CAMERA 8 0.224 0.097 1.12 #> 5 CAMERA 2 0.509 0.221 1.34 #> 6 CAMERA 1 1.14 0.497 2.73 #> 7 CAMERA 12 0 0 1 #> 8 CAMERA 4 1.31 0.57 3.55 #> 9 CAMERA 11 0 0 1 #> 10 CAMERA 3 - Bait 0.562 0.244 1.6 #> 11 CAMERA 1 - Bait 0 0 1 #> 12 CAMERA 19 0.637 0.276 1.80 #> 13 FCPEN 0.131 0.057 1.06 # Compare results all(alpha1 == alpha2) # TRUE #> [1] TRUE"},{"path":"https://stangandaho.github.io/maimer/reference/mm_app.html","id":null,"dir":"Reference","previous_headings":"","what":"Run App — mm_app","title":"Run App — mm_app","text":"Launch maimer GUI image/video management","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_app.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run App — mm_app","text":"","code":"mm_app()"},{"path":"https://stangandaho.github.io/maimer/reference/mm_boot_CI.html","id":null,"dir":"Reference","previous_headings":"","what":"Bootstrap confidence intervals — mm_boot_CI","title":"Bootstrap confidence intervals — mm_boot_CI","text":"Confidence interval calculation bootstrap samples.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_boot_CI.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bootstrap confidence intervals — mm_boot_CI","text":"","code":"mm_boot_CI(t0, bt, conf = 0.95)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_boot_CI.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bootstrap confidence intervals — mm_boot_CI","text":"t0 statistic estimated original sample, usually output mm_overlap_estimates() bt vector bootstrap statistics, usually output mm_boot_estimates() conf (single!) confidence interval estimate.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":null,"dir":"Reference","previous_headings":"","what":"Interactive Camera Trap Location Adjustment — mm_check_location","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"function launches shiny application allows users visualize manually adjust geographic coordinates camera trap locations. Users can drag points interactive map update positions camera traps, updated dataset saved global environment.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"","code":"mm_check_location( data, longitude, latitude, location_name, coord_system = c(\"geographic\", \"projected\"), crs, new_data_name )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"data data frame containing camera trap data processed. longitude string representing column name longitude dataset. latitude string representing column name latitude dataset. location_name string representing column name location name unique identifier camera trap point. coord_system string specifying coordinate system input data. Choices \"geographic\" longitude latitude, \"projected\" projected coordinates. crs integer representing coordinate reference system (CRS) EPSG format. Required coord_system = \"projected\". new_data_name string specifying name new dataset updated coordinates created global environment.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"shiny application launched display map allow manual coordinate adjustments. modified dataset saved global environment name provided new_data_name.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"function queries Integrated Taxonomic Information System (ITIS) find taxonomic details given species name. can search using either scientific name common name return relevant taxonomic information, including TSN.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"","code":"mm_check_name(species_name, search_type, ask = FALSE)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"species_name character string specifying species name search . single name allowed. search_type character string specifying type search. Options: \"sientific_name\": Search scientific name. \"common_name\": Search common name. ask logical value (TRUE FALSE). TRUE, allows interactive selection multiple matches found.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"tibble containing taxonomic details: search: original species name queried. tsn: Taxonomic Serial Number (TSN) ITIS. common_name: common name species (available). scientific_name: scientific name species. author: author classified species. itis_url: direct link species report ITIS. taxon_status: taxonomic status species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"necessary packages (httr2, xml2) installed, function prompts user install . multiple results found ask = TRUE, user prompted select correct match. exact match found, results displayed manual selection.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"","code":"if (FALSE) { # \\dontrun{ # Search for a species by scientific name mm_check_name(\"Panthera leo\", search_type = \"sientific_name\") # Search by common name with interactive selection mm_check_name(\"Lion\", search_type = \"common_name\", ask = TRUE) } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":null,"dir":"Reference","previous_headings":"","what":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"Create Add Hierarchical Subject Values Image Metadata","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"","code":"mm_create_hs(path, value = c(), intern = TRUE, quiet = TRUE, ...)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"path character vector specifying full path image file. value named character vector specifying new hierarchical subjects add. value must parent specified name, e.g c(\"Species\" = \"Vulture\"). intern TRUE output returned character vector. quiet Suppress output command . ... additional arguments passed system2()","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Get Hierarchical Subject from the image - Before use mm_create_hs() mm_get_hs(path = image_path) #==> NULL #> [1] \"Species|Vulture\" mm_create_hs(path = image_path, value = c(\"Species\" = \"Vulture\")) #> Warning: error in running command #> [1] # Get Hierarchical Subject from the image - Before use mm_create_hs() mm_get_hs(path = image_path) #==> \"Species|Vulture\" #> [1] \"Species|Vulture\""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate dissimilarity between communities — mm_dissimilarity","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"function computes dissimilarity indices useful popular community ecologists. indices use quantitative data, although named corresponding binary index, can calculate binary index using appropriate argument. find favourite index , can see can implemented using designdist. Gower, Bray–Curtis, Jaccard Kulczynski indices good detecting underlying ecological gradients (Faith et al. 1987). Morisita, Horn–Morisita, Binomial, Cao Chao indices able handle different sample sizes (Wolda 1981, Krebs 1999, Anderson & Millar 2004), Mountford (1962) Raup-Crick indices presence–absence data able handle unknown (variable) sample sizes. indices discussed Krebs (1999) Legendre & Legendre (2012), properties compared Wolda (1981) Legendre & De Cáceres (2012). Aitchison (1986) distance equivalent Euclidean distance CLR-transformed samples (\"clr\") deals positive compositional data. Robust Aitchison distance Martino et al. (2019) uses robust CLR (\"rlcr\"), making applicable non-negative data including zeroes (unlike standard Aitchison).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"","code":"mm_dissimilarity( data, to_community = FALSE, site_column, species_column, size_column = NULL, method = \"bray\", binary = FALSE, diag = FALSE, upper = FALSE, na.rm = FALSE, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"data data frame matrix containing species abundance data. rows represent sites (samples), columns represent species. data can raw transformed format (to_community = TRUE). to_community logical indicating whether input data transformed community data (site row species column). Default FALSE. site_column name column representing site/sample identifiers (used to_community = TRUE). species_column name column representing species identifiers (used to_community = TRUE). size_column name column representing size abundance counts species site (optional, used to_community = TRUE). method character string indicating distance measure use calculating beta diversity. available methods : \"manhattan\", \"euclidean\", \"canberra\", \"bray\", \"kulczynski\", \"gower\", \"morisita\", \"horn\", \"mountford\", \"jaccard\", \"raup\", \"binomial\", \"chao\", \"altGower\", \"cao\", \"mahalanobis\", \"clark\", \"chisq\", \"chord\", \"hellinger\", \"aitchison\", \"robust.aitchison\". default \"bray\". binary logical indicating whether transform data presence/absence (binary data) calculating dissimilarities. Default FALSE. diag logical indicating whether include diagonal output dissimilarity matrix. Default FALSE (diagonal values omitted). upper logical indicating whether return upper triangular part dissimilarity matrix. Default FALSE. na.rm logical indicating whether remove NA values data calculating dissimilarities. Default FALSE. FALSE, error raised missing values data. ... Additional arguments passed functions, transformation functions data scaling standardization.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"distance matrix (class dist) containing pairwise dissimilarities sites. dissimilarities calculated according chosen distance metric, various attributes (e.g., method, size, labels) attached result.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"Jaccard (\"jaccard\"), Mountford (\"mountford\"), Raup–Crick (\"raup\"), Binomial Chao indices discussed later section. function also finds indices presence/ absence data setting binary = TRUE. following overview gives first quantitative version, \\(x_{ij}\\) \\(x_{ik}\\) refer quantity species (column) \\(\\) sites (rows) \\(j\\) \\(k\\). binary versions \\(\\) \\(B\\) numbers species compared sites, \\(J\\) number species occur compared sites similarly designdist (many indices produce identical binary versions): Jaccard index computed \\(2B/(1+B)\\), \\(B\\) Bray–Curtis dissimilarity. Binomial index derived Binomial deviance null hypothesis two compared communities equal. able handle variable sample sizes. index fixed upper limit, can vary among sites shared species. discussion, see Anderson & Millar (2004). Cao index CYd index (Cao et al. 1997) suggested minimally biased index high beta diversity variable sampling intensity. Cao index fixed upper limit, can vary among sites shared species. index intended count (integer) data, undefined zero abundances; replaced arbitrary value \\(0.1\\) following Cao et al. (1997). Cao et al. (1997) used \\(\\log_{10}\\), current function uses natural logarithms values approximately \\(2.30\\) times higher 10-based logarithms. Anderson & Thompson (2004) give alternative formulation Cao index highlight relationship Binomial index (). Mountford index defined \\(M = 1/\\alpha\\) \\(\\alpha\\) parameter Fisher's logseries assuming compared communities samples community (cf. fisherfit, fisher.alpha). index \\(M\\) found positive root equation \\(\\exp() + \\exp(bM) = 1 + \\exp[(+b-j)M]\\), \\(j\\) number species occurring communities, \\(\\) \\(b\\) number species separate community (index uses presence–absence information). Mountford index usually misrepresented literature: indeed Mountford (1962) suggested approximation used starting value iterations, proper index defined root equation . function vegdist solves \\(M\\) Newton method. Please note either \\(\\) \\(b\\) equal \\(j\\), one communities subset , dissimilarity \\(0\\) meaning non-identical objects may regarded similar index non-metric. Mountford index range \\(0 \\dots \\log(2)\\). Raup–Crick dissimilarity (method = \"raup\") probabilistic index based presence/absence data. defined \\(1 - prob(j)\\), based probability observing least \\(j\\) species shared compared communities. current function uses analytic result hypergeometric distribution (phyper) find probabilities. probability (index) dependent number species missing sites, adding -zero species data removing missing species data influence index. probability ( index) may almost zero almost one wide range parameter values. index nonmetric: two communities shared species may dissimilarity slightly one, two identical communities may dissimilarity slightly zero. index uses equal occurrence probabilities species, Raup Crick originally suggested sampling probabilities proportional species frequencies (Chase et al. 2011). simulation approach unequal species sampling probabilities implemented raupcrick function following Chase et al. (2011). index can also used transposed data give probabilistic dissimilarity index species co-occurrence (identical Veech 2013). Chao index tries take account number unseen species pairs, similarly method = \"chao\" specpool. Function vegdist implements Jaccard, index defined \\(1-\\frac{U \\times V}{U + V - U \\times V}\\); types can defined function chaodist. Chao equation, \\(U = C_j/N_j + (N_k - 1)/N_k \\times a_1/(2 a_2) \\times S_j/N_j\\), \\(V\\) similar except site index \\(k\\). \\(C_j\\) total number individuals species site \\(j\\) shared site \\(k\\), \\(N_j\\) total number individuals site \\(j\\), \\(a_1\\) (\\(a_2\\)) number species occurring site \\(j\\) one (two) individuals site \\(k\\), \\(S_j\\) total number individuals species present site \\(j\\) occur one individual site \\(k\\) (Chao et al. 2005). Morisita index can used genuine count data (integers) . Horn–Morisita variant able handle abundance data. Mahalanobis distances Euclidean distances matrix columns centred, unit variance, uncorrelated. index commonly used community data, sometimes used environmental variables. calculation based transforming data matrix using Euclidean distances following Mardia et al. (1979). Mahalanobis transformation usually fails number columns larger number rows (sampling units). transformation fails, distances nearly constant except small numeric noise. Users must check returned Mahalanobis distances meaningful. Euclidean Manhattan dissimilarities good gradient separation without proper standardization still included comparison special needs. Chi-square distances (\"chisq\") Euclidean distances Chi-square transformed data (see decostand). internal standardization used correspondence analysis (cca, decorana). Weighted principal coordinates analysis distances row sums weights equal correspondence analysis (see Example wcmdscale). Chi-square distance intended non-negative data, typical community data. However, can calculated long margin sums positive, warning issued negative data entries. Chord distances (\"chord\") Euclidean distance matrix rows standardized unit norm (sums squares 1) using decostand. Geometrically standardization moves row points surface multidimensional unit sphere, distances chords across hypersphere. Hellinger distances (\"hellinger\") related Chord distances, data standardized unit total (row sums 1) using decostand, square root transformed. distances upper limit \\(\\sqrt{2}\\). Bray–Curtis Jaccard indices rank-order similar, indices become identical rank-order similar standardizations, especially presence/absence transformation equalizing site totals decostand. Jaccard index metric, probably preferred instead default Bray-Curtis semimetric. Aitchison distance (1986) robust Aitchison distance (Martino et al. 2019) metrics deal compositional data. Aitchison distance said outperform Jensen-Shannon divergence Bray-Curtis dissimilarity, due better stability subsetting aggregation, proper distance (Aitchison et al., 2000). naming conventions vary. one adopted traditional rather truthful priority. function finds either quantitative binary variants indices name, correctly may refer one alternatives instance, Bray index known also Steinhaus, Czekanowski Sørensen index. quantitative version Jaccard probably called Ružička index. abbreviation \"horn\" Horn–Morisita index misleading, since separate Horn index. abbreviation changed index implemented vegan.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"function alternative dist adding ecologically meaningful indices. methods produce similar types objects can interchanged method accepting either. Manhattan Euclidean dissimilarities identical methods. Canberra index divided number variables vegdist, dist. differ constant multiplier, alternative vegdist range (0,1). Function daisy (package cluster) provides alternative implementation Gower index also can handle mixed data numeric class variables. two versions Gower distance (\"gower\", \"altGower\") differ scaling: \"gower\" divides distances number observations (rows) scales column unit range, \"altGower\" omits double-zeros divides number pairs least one -zero value, scale columns (Anderson et al. 2006). can use decostand add range standardization \"altGower\" (see Examples). Gower (1971) suggested omitting double zeros presences, often taken general feature Gower distances. See Examples implementing Anderson et al. (2006) variant Gower index. dissimilarity indices vegdist designed community data, give misleading values negative data entries. results may also misleading NA NaN empty sites. principle, study species composition without species remove empty sites community data.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"Aitchison, J. Statistical Analysis Compositional Data (1986). London, UK: Chapman & Hall. Aitchison, J., Barceló-Vidal, C., Martín-Fernández, J.., Pawlowsky-Glahn, V. (2000). Logratio analysis compositional distance. Math. Geol. 32, 271–275. Anderson, M.J. Millar, R.B. (2004). Spatial variation effects habitat temperate reef fish assemblages northeastern New Zealand. Journal Experimental Marine Biology Ecology 305, 191–221. Anderson, M.J., Ellingsen, K.E. & McArdle, B.H. (2006). Multivariate dispersion measure beta diversity. Ecology Letters 9, 683–693. Anderson, M.J & Thompson, .. (2004). Multivariate control charts ecological environmental monitoring. Ecological Applications 14, 1921–1935. Cao, Y., Williams, W.P. & Bark, .W. (1997). Similarity measure bias river benthic Auswuchs community analysis. Water Environment Research 69, 95–106. Chao, ., Chazdon, R. L., Colwell, R. K. Shen, T. (2005). new statistical approach assessing similarity species composition incidence abundance data. Ecology Letters 8, 148–159. Chase, J.M., Kraft, N.J.B., Smith, K.G., Vellend, M. Inouye, B.D. (2011). Using null models disentangle variation community dissimilarity variation \\(\\alpha\\)-diversity. Ecosphere 2:art24 doi:10.1890/ES10-00117.1 Faith, D. P, Minchin, P. R. Belbin, L. (1987). Compositional dissimilarity robust measure ecological distance. Vegetatio 69, 57–68. Gower, J. C. (1971). general coefficient similarity properties. Biometrics 27, 623–637. Krebs, C. J. (1999). Ecological Methodology. Addison Wesley Longman. Legendre, P. & De Cáceres, M. (2012). Beta diversity variance community data: dissimilarity coefficients partitioning. Ecology Letters 16, 951–963. doi:10.1111/ele.12141 Legendre, P. Legendre, L. (2012) Numerical Ecology. 3rd English ed. Elsevier. Mardia, K.V., Kent, J.T. Bibby, J.M. (1979). Multivariate analysis. Academic Press. Martino, C., Morton, J.T., Marotz, C.., Thompson, L.R., Tripathi, ., Knight, R. & Zengler, K. (2019) novel sparse compositional technique reveals microbial perturbations. mSystems 4, 1. Mountford, M. D. (1962). index similarity application classification problems. : P.W.Murphy (ed.), Progress Soil Zoology, 43–50. Butterworths. Veech, J. . (2013). probabilistic model analysing species co-occurrence. Global Ecology Biogeography 22, 252–260. Wolda, H. (1981). Similarity indices, sample size diversity. Oecologia 50, 296–302.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"Jari Oksanen, contributions Tyler Smith (Gower index), Michael Bedward (Raup–Crick index), Leo Lahti (Aitchison robust Aitchison distance).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"function retrieves values Hierarchical Subject field image's metadata. uses exiftool read metadata processes results extract return unique hierarchical subjects.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"","code":"mm_get_hs(path)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"path character vector specifying full path image file.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"character vector unique hierarchical subjects exist, otherwise NULL.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Get Hierarchical Subject from the image mm_get_hs(path = image_path) #> [1] \"Species|Vulture\""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract image metadata — mm_get_metadata","title":"Extract image metadata — mm_get_metadata","text":"function extracts metadata image files located specified path. function can handle individual image files directories containing multiple images. uses exiftool utility read metadata can optionally save extracted metadata CSV file.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract image metadata — mm_get_metadata","text":"","code":"mm_get_metadata(path, recursive = FALSE, save_file = FALSE, file_name = \"\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract image metadata — mm_get_metadata","text":"path character vector full path names. Either directory path file path. path specified directory, function looks image (.jpeg/JPEG, jpg/JPG) inside extract tags bind single data.frame. recursive logical. listing recurse directories? applied path directory. save_file logical. Extracted metadata write disk? file_name character specifying name file save csv format. left empty save_file TRUE, default name metadata.csv. Note file saved save_file FALSE, even file name provided.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract image metadata — mm_get_metadata","text":"data.frame","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract image metadata — mm_get_metadata","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Extract metadata from the downloaded image metadata <- mm_get_metadata(path = image_path) # Extract metadata from all images in a directory (non-recursive) file.copy(image_path, file.path(dirname(image_path), \"large2.jpeg\")) #> [1] TRUE metadata_dir <- mm_get_metadata(path = dirname(image_path), recursive = FALSE) #> Processing image large.jpeg (1 of 2) #> Processing image large2.jpeg (2 of 2) unlink(file.path(dirname(image_path), \"large2.jpeg\"))"},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate Event Independence — mm_independence","title":"Evaluate Event Independence — mm_independence","text":"function calculates difference times evaluates whether events independent based given threshold. useful checking certain events dataset independent based time intervals.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate Event Independence — mm_independence","text":"","code":"mm_independence( data = NULL, species_column = NULL, datetime, format, threshold = 30 * 60, only = FALSE )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate Event Independence — mm_independence","text":"data data.frame, tbl_df, tbl containing event data. include column datetime values. NULL, function use deltatime argument instead data argument. species_column optional column name specifying species grouping. provided, independence assessed separately within species group. datetime character string specifying name column data contains datetime values. argument required data provided. format character string defining format used parse datetime values datetime column. threshold numeric value representing time difference threshold (seconds) determine whether events independent. Events considered independent time difference greater equal threshold. default 30 minutes (1800 seconds). logical value indicating whether return rows data identified independent events. TRUE, independent events returned. FALSE, entire data frame returned additional column indicating independence status. default TRUE.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate Event Independence — mm_independence","text":"data provided TRUE, tibble events identified independent. data provided FALSE, tibble original data additional columns indicating independent status deltatime differences. data provided, tibble deltatime values independent status.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate Event Independence — mm_independence","text":"","code":"library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union # Load example dataset cam_data <- read.csv(system.file(\"penessoulou_season1.csv\", package = \"maimer\")) # Independence without considering species occurrence indep1 <- cam_data %>% mm_independence(data = ., datetime = datetimes, format = \"%Y-%m-%d %H:%M:%S\", only = TRUE) sprintf(\"Independent observations: %s\", nrow(indep1)) #> [1] \"Independent observations: 177\" # Independence considering species occurrence indep2 <- cam_data %>% mm_independence(data = ., datetime = datetimes, format = \"%Y-%m-%d %H:%M:%S\", only = TRUE, species_column = \"species\") sprintf(\"Independent observations: %s\", nrow(indep2)) #> [1] \"Independent observations: 183\" # Use a standalone vector of datetime values dtime <- cam_data$datetimes mm_independence(datetime = dtime, format = \"%Y-%m-%d %H:%M:%S\", only = TRUE) #> # A tibble: 177 × 1 #> datetime #> #> 1 2019-01-20 15:24:41 #> 2 2019-01-21 15:23:38 #> 3 2019-01-23 15:35:20 #> 4 2019-01-24 06:01:07 #> 5 2023-09-20 16:15:28 #> 6 2023-09-21 13:32:45 #> 7 2024-03-02 22:32:10 #> 8 2024-03-10 10:21:56 #> 9 2024-03-10 15:04:38 #> 10 2024-03-10 17:28:11 #> # ℹ 167 more rows"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimates of coefficient of overlapping — mm_overlap_estimates","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"Estimates coefficient overlapping","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"","code":"mm_overlap_estimates( A, B, kmax = 3, adjust = c(0.8, 1, 4), n_grid = 128, type = c(\"all\", \"Dhat1\", \"Dhat4\", \"Dhat5\") )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"numeric vector time--day observations (radians) species . B numeric vector time--day observations (radians) species B. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. n_grid integer specifying number grid points density estimation. Default 128. type name estimator use: Dhat4 recommended samples larger 50, otherwise use Dhat1. See Details. default \"\" compatibility older versions.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"See overlapTrue meaning coefficient overlapping, \\(\\Delta\\). estimators \\(\\Delta\\) use kernel density estimates fitted data approximate true density functions f(t) g(t). Schmid & Schmidt (2006) propose five estimators overlap: Dhat1 calculated vectors densities estimated T equally-spaced times, t, 0 \\(2\\pi\\): circular distributions, Dhat2 equivalent Dhat1, Dhat3 inapplicable. Dhat4 Dhat5 use vectors densities estimated times observations species, x y: n, m sample sizes indicator function (1 condition true, 0 otherwise). Dhat5 simply checks curve higher point; even tiny changes data can result large, discontinuous changes Dhat5, can take values > 1. use Dhat5. Comparing curves times actual observations works well enough observations species. Simulations show Dhat4 best smallest sample least 50 observations. Dhat1 compares curves n.grid equally spaced points, best small samples.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"","code":"set.seed(42) species_A <- runif(100, 1.2, 2 * pi) species_B <- runif(100, 0.23, 2 * pi) mm_overlap_estimates(species_A, species_B) #> Dhat1 Dhat4 Dhat5 #> 0.8579292 0.8573376 0.8400000 mm_overlap_estimates(species_A, species_B, type = \"Dhat4\") #> Dhat4 #> 0.8573376"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"function calculates pairwise overlap coefficients activity patterns multiple species using time data.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"","code":"mm_overlap_matrix( data, species_column, time_column, convert_time = F, format = \"%H:%M:%S\", fill_na = NULL, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"data data.frame tibble containing species time information. species_column column data indicating species names. time_column column data containing time data (either radians time format converted). convert_time Logical. TRUE, time data converted radians using mm_to_radian function. format character string specifying time format (e.g., \"%H:%M:%S\") mm_to_radian() TRUE. Defaults \"%H:%M:%S\". fill_na Optional. numeric value used fill NA values overlap coefficient matrix. Defaults NULL (fill NA values). ... Additional arguments passed overlap::overlapEst()` overlap estimation.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"square matrix pairwise overlap coefficients, rows columns represent species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"function calculates pairwise overlap coefficients species dataset. overlap coefficients estimated using overlap package: species pairs sample sizes least 50 observations , Dhat4 estimator used. smaller sample sizes, Dhat1 estimator used (Schmid & Schmidt, 2006).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"Schmid & Schmidt (2006) Nonparametric estimation coefficient overlapping - theory empirical application, Computational Statistics Data Analysis, 50:1583-1596.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"","code":"# Example dataset data <- data.frame( species = c(\"SpeciesA\", \"SpeciesA\", \"SpeciesB\", \"SpeciesB\"), time = c(\"10:30:00\", \"11:45:00\", \"22:15:00\", \"23:30:00\") ) # Calculate overlap coefficients with time conversion overlap_matrix <- mm_overlap_matrix( data = data, species_column = species, time_column = time, convert_time = TRUE, format = \"%H:%M:%S\" ) # Fill missing values in the matrix with 0 overlap_matrix_filled <- mm_overlap_matrix( data = data, species_column = species, time_column = time, convert_time = TRUE, fill_na = 0 )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot overlap between two species' activity patterns — mm_plot_density","title":"Plot overlap between two species' activity patterns — mm_plot_density","text":"function visualizes temporal overlap two species' activity patterns based time--day data. uses kernel density estimation estimate activity densities highlights areas overlap two species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot overlap between two species' activity patterns — mm_plot_density","text":"","code":"mm_plot_density( time, xscale = 24, xcenter = c(\"noon\", \"midnight\"), n_grid = 128, kmax = 3, adjust = 1, rug = FALSE, linetype = 2, linecol = \"gray10\", linewidth = 1, rug_lentgh = 0.018, rug_color = \"gray30\", extend = \"lightgrey\", extend_alpha = 0.8, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot overlap between two species' activity patterns — mm_plot_density","text":"time numeric vector time--day observations (radians, 0 \\(2\\pi\\)). xscale numeric value scale x-axis. Default 24 representing time hours. xcenter string indicating center x-axis. Options \"noon\" (default) \"midnight\". n_grid integer specifying number grid points density estimation. Default 128. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. rug logical value indicating whether include rug plot observations. Default FALSE. linetype numeric specifying line types. Default c(1, 2). linecol string specifying colors density lines species B. Default c(\"gray10\", \"gray0\"). linewidth numeric value specifying line widths species B density lines. Default c(1, 1). rug_lentgh numeric value specifying length rug ticks. Default 0.018 (normalized plot coordinates). rug_color string specifying color rug ticks. Default \"gray30\". extend string specifying color extended area beyond activity period. Default \"lightgrey\". extend_alpha numeric value (0 1) transparency extended area. Default 0.8. ... Additional arguments passed geom_rug function.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot overlap between two species' activity patterns — mm_plot_density","text":"ggplot object representing activity density curves species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot overlap between two species' activity patterns — mm_plot_density","text":"","code":"if (FALSE) { # \\dontrun{ # Generate random data for two species set.seed(42) A <- runif(100, 0, 2 * pi) # Plot overlap with default settings mm_plot_density(A) # Customize plot with specific colors and line types mm_plot_density(A, linecol = \"gray10\", linewidth = 0.8, xcenter = \"midnight\", rug = T, rug_color = 'red', extend_alpha = 0) } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot overlap between two species' activity patterns — mm_plot_overlap","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"function visualizes temporal overlap two species' activity patterns based time--day data. uses kernel density estimation estimate activity densities highlights areas overlap two species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"","code":"mm_plot_overlap( A, B, xscale = 24, xcenter = c(\"noon\", \"midnight\"), n_grid = 128, kmax = 3, adjust = 1, rug = FALSE, overlap_color = \"gray40\", overlap_alpha = 0.8, linetype = c(1, 2), linecol = c(\"gray10\", \"gray0\"), linewidth = c(1, 1), overlap_only = FALSE, rug_lentgh = 0.018, rug_color = \"gray30\", extend = \"lightgrey\", extend_alpha = 0.8, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"numeric vector time--day observations (radians) species . B numeric vector time--day observations (radians) species B. xscale numeric value scale x-axis. Default 24 representing time hours. xcenter string indicating center x-axis. Options \"noon\" (default) \"midnight\". n_grid integer specifying number grid points density estimation. Default 128. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. rug logical value indicating whether include rug plot observations. Default FALSE. overlap_color string specifying color overlap area. Default \"gray40\". overlap_alpha numeric value (0 1) transparency overlap area. Default 0.8. linetype vector integers specifying line types species B density lines. Default c(1, 2). linecol vector strings specifying colors density lines species B. Default c(\"gray10\", \"gray0\"). linewidth vector numeric values specifying line widths species B density lines. Default c(1, 1). overlap_only logical value indicating whether plot overlap region without individual density lines. Default FALSE. rug_lentgh numeric value specifying length rug ticks. Default 0.018 (normalized plot coordinates). rug_color string specifying color rug ticks. Default \"gray30\". extend string specifying color extended area beyond activity period. Default \"lightgrey\". extend_alpha numeric value (0 1) transparency extended area. Default 0.8. ... Additional arguments passed geom_rug function.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"ggplot object representing activity density curves overlap two species. overlap_only = TRUE, overlap region displayed.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"function calculates kernel density estimates two sets time--day data (B) visualizes overlap. time--day data expressed radians (0 2π). Key features plot: x-axis can scaled represent hours (default xscale = 24) units. center x-axis can adjusted \"noon\" \"midnight\". shaded polygon highlights overlap region two density curves. Optionally includes rug plot indicate raw observations. Allows customization line types, colors, widths, transparency. Extended regions (beyond primary activity period) can highlighted clarity.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"","code":"if (FALSE) { # \\dontrun{ # Generate random data for two species set.seed(42) species_A <- runif(100, 0, 2 * pi) species_B <- runif(100, 0, 2 * pi) # Plot overlap with default settings mm_plot_overlap(A = species_A, B = species_B) # Customize plot with specific colors and line types mm_plot_overlap(A = species_A, B = species_B, overlap_color = \"blue\", linecol = c(\"red\", \"green\")) # Include rug plots and change transparency mm_plot_overlap(A = species_A, B = species_B, rug = TRUE, overlap_alpha = 0.5) } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"Visualizes overlap coefficient matrix.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"","code":"mm_plot_overlap_coef( data, side = c(\"lower\", \"upper\"), show = c(\"shape\", \"value\"), shape_type = 21, shape_size = 0.5, text_size = 6, text_font = NA, excludes = NULL, color_scale = \"gray3\", ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"data square matrix (e.g mm_overlap_matrix() output) representing overlap coefficients visualized. side character string indicating triangle matrix display. Options \"lower\" (default) \"upper\". show character string specifying whether display \"shape\" (default) \"value\" plot. shape_type Numeric value specifying type shape use plot. Defaults 21 (circle). shape_size Numeric value controlling stroke size shapes. Defaults 0.5. text_size Numeric value specifying size text show = \"value\". Defaults 6. text_font Character string specifying font family use text labels. Defaults NA. excludes vector numeric values exclude plot. Defaults NULL. color_scale character string vector colors define gradient color scale. Defaults \"gray3\". ... Additional arguments passed guide_colorbar function.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"ggplot object representing overlap coefficient matrix visualization.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"","code":"library(ggplot2) # Example overlap coefficient matrix overlap_matrix <- matrix(c(1, 0.8, 0.7, 0.8, 1, 0.9, 0.7, 0.9, 1), ncol = 3) colnames(overlap_matrix) <- rownames(overlap_matrix) <- c(\"A\", \"B\", \"C\") # Plot lower triangle with shapes mm_plot_overlap_coef(overlap_matrix, side = \"lower\", show = \"shape\") # Plot upper triangle with values mm_plot_overlap_coef(overlap_matrix, side = \"upper\", show = \"value\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a Delimited File into a Tibble — mm_read","title":"Read a Delimited File into a Tibble — mm_read","text":"mm_read function reads delimited text file. automatically detects delimiter specified provides easy--use interface importing data additional customization options.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a Delimited File into a Tibble — mm_read","text":"","code":"mm_read(file_path, header = TRUE, sep, ...)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a Delimited File into a Tibble — mm_read","text":"file_path string specifying path file read. header logical value indicating whether file contains header row. Defaults TRUE. sep field separator character. provided, function automatically detects separator. ... Additional arguments passed read.table function fine-tuned control file reading.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a Delimited File into a Tibble — mm_read","text":"tibble containing data specified file.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"mm_remove_hs function removes specific hierarchy Hierarchical Subject field image's metadata, removes entire field specific hierarchy provided. uses exiftool manipulate metadata ensure desired changes applied.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"","code":"mm_remove_hs(path, hierarchy = NULL, intern = TRUE, quiet = TRUE, ...)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"path character vector specifying full path image file. hierarchy named character vector, e.g c(\"Species\" = \"Vulture\") specifying hierarchy removed. NULL, entire Hierarchical Subject field removed. intern TRUE output returned character vector. quiet Suppress output command . ... additional arguments passed system2()","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"message indicating image updated","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Get Hierarchical Subject from the image no_hs <- mm_get_hs(path = image_path) mm_create_hs(image_path, c(\"A\" = \"AB\")) #> Warning: error in running command #> [1] mm_remove_hs(image_path, c(\"A\" = \"AB\")) #> [1] Hierarchy A|AB does not exist. No change applied to large.jpeg"},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"function calculates Observed Spatial Coverage species like Home Range, based camera trap data. term home range typically associated dynamic movement data, recorded radio-tracking GPS devices, provide continuous near-continuous tracking individual animal's movements. Since camera traps static capture presence/absence activity within specific locations, concept home range might fully apply.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"","code":"mm_spatial_coverage( data, site_column, size_column = NULL, longitude, latitude, crs = c(4326, NULL), study_area = NULL, resolution, spread_factor = 0.1 )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"data data frame containing species occurrence records, including site, longitude, latitude, optionally size (abundance). site_column Column name specifying site identifier. size_column Optional column specifying abundance species site. Defaults NULL, case counts per site used. longitude Column name specifying longitude observation sites. latitude Column name specifying latitude observation sites. crs vector length two specifying coordinate reference systems: c(crs1, crs2). crs1 represents current CRS data (e.g., 4326 latitude/longitude). crs2 represents CRS transform (e.g., \"EPSG:32631\", UTM EPSG code) accurate distance calculations. crs2 NULL, transformation applied. Defaults c(4326, NULL) study_area optional simple feature (sf) polygon representing study area. provided, raster extends cover area. resolution Numeric value specifying spatial resolution (grid size) rasterization. spread_factor scale factor half-normal distribution. Higher values create spread-distribution, lower values make concentrated. value must ]0; 1]","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"list containing: Coverage raster: raster object representing species abundance across space. Coverage stats: tibble spatial coverage statistics, including area (km²), average abundance, maximum abundance, standard deviation.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"function applies half-normal kernel model species abundance space, using scale rate control spread distribution: $$\\bar{K}(x) = \\frac{\\sum w * \\text{e}^{(-0.5 * (\\frac{x}{\\sigma})^2)}}{N}$$ : \\(\\bar{K}(x)\\) mean abundance kernel across sites, \\(w\\) species abundance site, \\(\\sigma\\) standard deviation spatial distance (scaled spread_factor), \\(N\\) total number sites.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"","code":"library(dplyr) cam_data <- system.file(\"penessoulou_season2.csv\", package = \"maimer\") %>% read.csv() %>% dplyr::filter(Species == \"Erythrocebus patas\") spc <- mm_spatial_coverage( data = cam_data, site_column = Camera, crs = \"EPSG:32631\", , resolution = 30, spread_factor = 0.4, size_column = Count, longitude = Longitude, latitude = Latitude ) ## Abundance stats spc[[2]] %>% dplyr::select(-1) #> # A tibble: 1 × 4 #> `Spatial coverage (km²)` `Average abundance` `Maximum abundance` #> #> 1 22.6 7 13 #> # ℹ 1 more variable: `Standard Deviation` ## Plot spatial coverage library(ggplot2) spc_vect <- terra::as.polygons(spc[[1]]) %>% sf::st_as_sf() ggplot() + geom_sf(data = spc_vect, aes(fill = Abundance), color = NA) + theme_minimal() + scale_fill_viridis_c()"},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Stack a list of data frame — mm_stack_df","title":"Stack a list of data frame — mm_stack_df","text":"function takes list data frames stacks single data frame. ensures columns input data frames list included output, filling missing columns NA values necessary.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack a list of data frame — mm_stack_df","text":"","code":"mm_stack_df(df_list)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack a list of data frame — mm_stack_df","text":"df_list list data frame stacked","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Stack a list of data frame — mm_stack_df","text":"data frame","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Stack a list of data frame — mm_stack_df","text":"","code":"x <- data.frame(age = 15, fruit = \"Apple\", weight = 12) y <- data.frame(age = 51, fruit = \"Tomato\") z <- data.frame(age = 26, fruit = \"Lemo\", weight = 12, height = 45) alldf <- list(x,y,z) mm_stack_df(alldf) #> # A tibble: 3 × 4 #> age fruit weight height #> #> 1 15 Apple 12 NA #> 2 51 Tomato NA NA #> 3 26 Lemo 12 45"},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":null,"dir":"Reference","previous_headings":"","what":"Standardize community data matrix — mm_standardize","title":"Standardize community data matrix — mm_standardize","text":"function standardizes given data matrix using different methods total sum scaling, max normalization, frequency scaling, standardization, presence-absence transformation, chi-square transformation, Hellinger transformation, log transformation, others.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Standardize community data matrix — mm_standardize","text":"","code":"mm_standardize( data, method, margin, range_global, logbase = 2, na.rm = FALSE, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Standardize community data matrix — mm_standardize","text":"data numeric matrix data frame standardized. method character string specifying standardization method (see details). Available methods : \"total\": Divides entry total sum given margin. \"max\": Divides entry maximum value given margin. \"frequency\": Frequency transformation. \"normalize\": Normalization Euclidean norm. \"range\": Standardizes range (min-max scaling). \"rank\": Converts values ranks. \"rrank\": Relative rank transformation. \"standardize\": Standardization (z-score normalization). \"pa\": Presence-absence transformation (binary). \"chi.square\": Chi-square standardization. \"hellinger\": Hellinger transformation. \"log\": Log transformation. \"clr\": Centered log-ratio transformation. \"rclr\": Robust centered log-ratio transformation. \"alr\": Additive log-ratio transformation. margin integer specifying margin standardization: 1: Rows 2: Columns range_global matrix specifying range standardization (optional, used \"range\" method). logbase base logarithmic transformation (default 2). na.rm Logical. TRUE, missing values (NA) removed calculations. ... Additional arguments passed transformation functions.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Standardize community data matrix — mm_standardize","text":"standardized matrix tibble attributes specifying transformation applied.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Standardize community data matrix — mm_standardize","text":"function provides following standardization methods community data: \"total\": Divides margin total (default margin = 1). \"max\": Divides margin maximum (default margin = 2). \"frequency\": Divides margin total multiplies number non-zero items, ensuring average non-zero entries one (Oksanen 1983; default margin = 2). \"normalize\": Scales data sum squares along specified margin equals one (default margin = 1). \"range\": Standardizes values range [0,1] (default margin = 2). values constant, transformed 0. \"rank\", \"rrank\": \"rank\" replaces abundance values increasing ranks, leaving zeros unchanged. \"rrank\" similar uses relative ranks maximum 1 (default margin = 1). \"standardize\": Scales x zero mean unit variance (default margin = 2). \"pa\": Converts x presence/absence scale (0/1). \"chi.square\": Divides row sums square root column sums, adjusts square root matrix total (Legendre & Gallagher 2001). used Euclidean distance, distances similar Chi-square distances correspondence analysis (default margin = 1). \"hellinger\": Computes square root method = \"total\" (Legendre & Gallagher 2001). \"log\": Logarithmic transformation suggested Anderson et al. (2006): $$\\log_b (x) + 1$$ \\(x > 0\\), \\(b\\) base logarithm. Zeros remain unchanged. Higher bases give less weight quantities presences. \"alr\": Additive log ratio (ALR) transformation (Aitchison 1986). Reduces skewness compositional bias. Requires positive values; pseudocounts can added. transformation defined : $$alr = [\\log(x_1 / x_D), ..., \\log(x_{D-1} / x_D)]$$ denominator sample \\(x_D\\) can chosen arbitrarily. \"clr\": Centered log ratio (CLR) transformation (Aitchison 1986). Common microbial ecology (Gloor et al. 2017). supports positive data; pseudocounts can used handle zeros. transformation defined : $$clr = \\log(x / g(x)) = \\log x - \\log g(x)$$ \\(x\\) single value, \\(g(x)\\) geometric mean \\(x\\). \"rclr\": Robust CLR transformation. Unlike CLR, method allows zeros without requiring pseudocounts. divides values geometric mean observed (non-zero) features, preserving zeros (Martino et al. 2019). transformation defined : $$rclr = \\log(x / g(x > 0))$$ \\(x\\) single value, \\(g(x > 0)\\) geometric mean sample-wide values \\(x\\) positive (\\(x > 0\\)). Standardization, contrasted transformation, means entries transformed relative entries. methods default margin. margin=1 means rows (sites normal data set) margin=2 means columns (species normal data set). Command wisconsin shortcut common Wisconsin double standardization species (margin=2) first standardized maxima (max) sites (margin=1) site totals (tot). standardization methods give nonsense results negative data entries normally occur community data. empty sites species (constant method = \"range\"), many standardization change NaN. Function decobackstand can used transform standardized data back original. possible standardization may implemented cases possible. round-errors back-transformation exact, wise overwrite original data. zap=TRUE original zeros exact.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Standardize community data matrix — mm_standardize","text":"function adapted decostand function vegan R package, modifications improved handling.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Standardize community data matrix — mm_standardize","text":"Aitchison, J. Statistical Analysis Compositional Data (1986). London, UK: Chapman & Hall. Anderson, M.J., Ellingsen, K.E. & McArdle, B.H. (2006) Multivariate dispersion measure beta diversity. Ecology Letters 9, 683–693. Egozcue, J.J., Pawlowsky-Glahn, V., Mateu-Figueras, G., Barcel'o-Vidal, C. (2003) Isometric logratio transformations compositional data analysis. Mathematical Geology 35, 279–300. Gloor, G.B., Macklaim, J.M., Pawlowsky-Glahn, V. & Egozcue, J.J. (2017) Microbiome Datasets Compositional: Optional. Frontiers Microbiology 8, 2224. Legendre, P. & Gallagher, E.D. (2001) Ecologically meaningful transformations ordination species data. Oecologia 129, 271–280. Martino, C., Morton, J.T., Marotz, C.., Thompson, L.R., Tripathi, ., Knight, R. & Zengler, K. (2019) novel sparse compositional technique reveals microbial perturbations. mSystems 4, 1. Oksanen, J. (1983) Ordination boreal heath-like vegetation principal component analysis, correspondence analysis multidimensional scaling. Vegetatio 52, 181–189.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Standardize community data matrix — mm_standardize","text":"","code":"# Example usage with sample data cam_data <- read.csv(system.file('penessoulou_season1.csv', package = 'maimer')) cam_data <- cam_data %>% mm_to_community(site_column = camera, species_column = species, size_column = number, values_fill = 0) standardized_data <- mm_standardize(data = cam_data[, 2:11], method = \"total\") standardized_data #> # A tibble: 13 × 10 #> `Syncerus caffer` `Lepus crawshayi` `Erythrocebus patas` #> #> 1 0.981 0 0.0169 #> 2 0 0.375 0.5 #> 3 0.430 0 0.522 #> 4 0.941 0 0 #> 5 0 0 0.0714 #> 6 0.480 0 0.341 #> 7 0 0 1 #> 8 0.247 0 0.306 #> 9 0 0 0 #> 10 0 0 0 #> 11 0 0 0 #> 12 0 0 0 #> 13 0.0240 0 0.974 #> # ℹ 7 more variables: `Tragelaphus scriptus` , #> # `Chlorocebus aethiops` , `Canis adustus` , #> # `Mellivora capensis` , `Sylvicapra grimmia` , #> # `Thryonomys swinderianus` , `Genetta genetta` "},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"function estimates analyzes temporal shift activity species two time periods using kernel density estimation. computes activity distributions determines magnitude direction shift.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"","code":"mm_temporal_shift( first_period, second_period, convert_time = FALSE, xscale = 24, xcenter = c(\"noon\", \"midnight\"), n_grid = 128, kmax = 3, adjust = 1, width_at = 1/2, format = \"%H:%M:%S\", time_zone, plot = TRUE, linestyle_1 = list(), linestyle_2 = list(), posestyle_1 = list(), posestyle_2 = list(), ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"first_period numeric vector representing activity times radians first period. second_period numeric vector representing activity times radians second period. convert_time Logical. TRUE, converts times radians analysis. xscale numeric value scale x-axis. Default 24 representing time hours. xcenter string indicating center x-axis. Options \"noon\" (default) \"midnight\". n_grid integer specifying number grid points density estimation. Default 128. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. width_at Numeric. fraction maximum density activity width measured (default 0.5). format Character. Format time input (default \"%H:%M:%S\"). Used convert_time = TRUE. time_zone Character. Time zone time conversion. Required convert_time = TRUE. plot Logical. TRUE, generates plot comparing activity distributions two periods. linestyle_1 List. Line style settings first period's density plot. Includes linetype, linewidth, color. linestyle_2 List. Line style settings second period's density plot. Includes linetype, linewidth, color. posestyle_1 List. Marker style settings first period's density range. Includes shape, size, color, alpha. posestyle_2 List. Marker style settings second period's density range. Includes shape, size, color, alpha. ... Additional arguments (currently unused).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"list containing: tibble : First period range: start end times active periods first dataset. Second period range: start end times active periods second dataset. Shift size (hour): absolute difference activity duration two periods. Move: categorical description shift (\"Forward\", \"Backward\", \"Expanded\", \"Contracted\", etc.). plot (optional): ggplot2 object visualizing density distributions plot = TRUE.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"","code":"library(ggplot2) # Using radians as input first_period <- c(1.3, 2.3, 2.5, 5.2, 6.1, 2.3) # Example timestamps for period 1 second_period <- c(1.8, 2.2, 2.5) # Example timestamps for period 2 result <- mm_temporal_shift(first_period, second_period, plot = TRUE, xcenter = \"noon\", linestyle_1 = list(color = \"gray10\", linetype = 1, linewidth = 1), linestyle_2 = list(color = \"#b70000\", linetype = 5, linewidth = .5)) result #> [[1]] #> # A tibble: 1 × 4 #> `First period range` `Second period range` `Shift size (in hour)` Move #> #> 1 06:59:32 - 10:34:58 06:25:31 - 10:12:18 0.19 Backward #> #> $plot #> # customize the graph associated result result$plot+ labs(color = \"Periods\")+ theme(legend.position = \"top\") # Using time strings as input first_period <- c(\"12:03:05\", \"13:10:09\", \"14:08:10\", \"14:18:30\", \"18:22:11\") second_period <- c(\"13:00:20\", \"14:20:10\", \"15:55:20\", \"16:03:01\", \"16:47:00\") result <- mm_temporal_shift(first_period, second_period, convert_time = TRUE, format = \"%H:%M:%S\", time_zone = \"UTC\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Data to a Community Matrix — mm_to_community","title":"Convert Data to a Community Matrix — mm_to_community","text":"function transforms input data community matrix rows represent sites, columns represent species, values indicate count abundance species site.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Data to a Community Matrix — mm_to_community","text":"","code":"mm_to_community( data, site_column, species_column, size_column, values_fill = NULL )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Data to a Community Matrix — mm_to_community","text":"data data frame containing input data. site_column column data frame representing site identifiers. Can specified string unquoted column name. species_column column data frame representing species identifiers. Can specified string unquoted column name. size_column (Optional) column representing size abundance species site. provided, counts species occurrences calculated. values_fill (Optional) value fill missing cells resulting community matrix. Defaults NULL.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Data to a Community Matrix — mm_to_community","text":"tibble rows represent sites, columns represent species, values represent count abundance species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert Data to a Community Matrix — mm_to_community","text":"function creates site--species matrix suitable ecological analysis. size_column provided, function counts occurrences species per site. size_column provided, values used measure species abundance.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Data to a Community Matrix — mm_to_community","text":"","code":"# Example data df <- dplyr::tibble( site = c(\"A\", \"A\", \"B\", \"B\", \"C\"), species = c(\"sp1\", \"sp2\", \"sp1\", \"sp3\", \"sp2\"), abundance = c(5, 2, 3, 1, 4) ) # Convert to community matrix with counts mm_to_community(df, site_column = site, species_column = species) #> # A tibble: 3 × 4 #> site sp1 sp2 sp3 #> #> 1 A 1 1 NA #> 2 B 1 NA 1 #> 3 C NA 1 NA # Convert to community matrix with abundance mm_to_community(df, site_column = site, species_column = species, size_column = abundance) #> # A tibble: 3 × 4 #> site sp1 sp2 sp3 #> #> 1 A 5 2 NA #> 2 B 3 NA 1 #> 3 C NA 4 NA # Fill missing cells with 0 mm_to_community(df, site_column = site, species_column = species, values_fill = 0) #> # A tibble: 3 × 4 #> site sp1 sp2 sp3 #> #> 1 A 1 1 0 #> 2 B 1 0 1 #> 3 C 0 1 0"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert camera trap data to occupancy format — mm_to_occupancy","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"function transforms camera trap detection data occupancy format suitable analysis. aggregates detections user-defined time windows optionally converts counts presence-absence (0/1) data.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"","code":"mm_to_occupancy( data, date_column, format = \"%Y-%m-%d\", site_column, species_column, size_column, by_day = 7, presence_absence = TRUE )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"data data frame containing camera trap detection records. date_column name column containing detection dates. format character string. specified converting character representation, try c(\"%Y-%m-%d\", \"%Y/%m/%d\") one one, give error none works. Otherwise, processing via strptime() whose help page describes available conversion specifications. site_column name column identifying sampling sites. species_column name column containing species names. Can NULL species information needed. size_column name column representing detection counts. by_day integer specifying number days per time window (default: 7). presence_absence Logical. TRUE, converts counts presence-absence data (1 = detected, 0 = detected). Default TRUE.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"wide-format data frame rows represent sites (optionally species), columns represent detection windows. Values indicate either detection counts presence-absence (0/1).","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"","code":"data <- data.frame( date = c(\"01-01-2023\", \"03-01-2023\", \"10-01-2023\", \"15-01-2023\"), site = c(\"A\", \"A\", \"B\", \"B\"), species = c(\"Tiger\", \"Tiger\", \"Deer\", \"Deer\"), count = c(1, 2, 3, 1) ) occupancy_data <- mm_to_occupancy( data, date_column = date, site_column = site, species_column = species, size_column = count, by_day = 7, presence_absence = TRUE ) occupancy_data #> # A tibble: 4 × 732 #> site species `1-01-20 to 1-01-26` `1-01-27 to 1-02-02` `1-02-03 to 1-02-09` #> #> 1 A Deer 0 0 0 #> 2 A Tiger 0 0 0 #> 3 B Deer 0 0 0 #> 4 B Tiger 0 0 0 #> # ℹ 727 more variables: `1-02-10 to 1-02-16` , `1-02-17 to 1-02-23` , #> # `1-02-24 to 1-03-02` , `1-03-03 to 1-03-09` , #> # `1-03-10 to 1-03-16` , `1-03-17 to 1-03-23` , #> # `1-03-24 to 1-03-30` , `1-03-31 to 1-04-06` , #> # `1-04-07 to 1-04-13` , `1-04-14 to 1-04-20` , #> # `1-04-21 to 1-04-27` , `1-04-28 to 1-05-04` , #> # `1-05-05 to 1-05-11` , `1-05-12 to 1-05-18` , …"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert time to radians — mm_to_radian","title":"Convert time to radians — mm_to_radian","text":"function converts time values radians, often used circular statistics time--day analyses.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert time to radians — mm_to_radian","text":"","code":"mm_to_radian(data, times, format = \"%H:%M:%S\", time_zone = \"UTC\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert time to radians — mm_to_radian","text":"data data frame containing column time values. Optional. NULL, times parameter treated standalone vector. times column name data vector time values converted. Time values format recognized .POSIXct(). format string specifying format time values, using standard POSIX formatting syntax. Default \"%H:%M:%S\". time_zone string specifying time zone interpreting time values. Default \"UTC\".","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert time to radians — mm_to_radian","text":"data provided, function returns input data frame additional column named time_radian. data provided, function returns numeric vector time values converted radians.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert time to radians — mm_to_radian","text":"function converts time values radians based 24-hour clock: full day (24 hours) corresponds \\(2\\pi\\) radians. fractional time day calculated : $$\\text{Fraction day} = \\frac{\\text{hours}}{24} + \\frac{\\text{minutes}}{1440} + \\frac{\\text{seconds}}{86400}$$ example, time 23 hours, 6 minutes, 12 seconds: $$\\text{Fraction day} = \\frac{23}{24} + \\frac{6}{1440} + \\frac{12}{86400}$$ convert fraction radians: $$\\text{Radians} = \\text{Fraction day} \\times 2\\pi$$","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert time to radians — mm_to_radian","text":"","code":"if (FALSE) { # \\dontrun{ # Convert a standalone vector of time values times <- c(\"00:00:00\", \"06:00:00\", \"12:00:00\", \"18:00:00\") mm_to_radian(times = times, format = \"%H:%M:%S\") # Convert a column of time values in a data frame data <- data.frame(times = c(\"00:00:00\", \"06:00:00\", \"12:00:00\", \"18:00:00\")) mm_to_radian(data = data, times = times, format = \"%H:%M:%S\") } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Radian to Time — mm_to_time","title":"Convert Radian to Time — mm_to_time","text":"function converts angle radians (representing fraction full circle) time format '%H:%M:%S'. conversion assumes radian value represents fraction 24-hour day (.e., 0 radians midnight \\(2\\pi\\) radians next midnight).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Radian to Time — mm_to_time","text":"","code":"mm_to_time(radian)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Radian to Time — mm_to_time","text":"radian numeric value vector representing angle radians. value must lie within range \\([0, 2\\pi]\\), 0 corresponds midnight (00:00:00) \\(2\\pi\\) corresponds next midnight (24:00:00).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Radian to Time — mm_to_time","text":"character string representing time format '%H:%M:%S'.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Radian to Time — mm_to_time","text":"","code":"# Convert 1.6 radians to time mm_to_time(1.6) #> [1] \"06:06:42\" # Output: \"06:06:42\""},{"path":"https://stangandaho.github.io/maimer/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"Pipe operator Pipe operator","code":""},{"path":"https://stangandaho.github.io/maimer/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs lhs %<>% rhs"},{"path":[]},{"path":"https://stangandaho.github.io/maimer/news/index.html","id":"first-release-highlights-0-2-0","dir":"Changelog","previous_headings":"","what":"First Release Highlights","title":"maimer 0.2.0","text":"Initial release maimer Provides tidyverse-friendly functions data cleaning, transformation, visualization. Includes support alpha & beta diversity, species activity overlap, temporal analysis. Integrates ggplot2 customizable visualizations. Features interactive Shiny app image metadata handling","code":""}]
+[{"path":"https://stangandaho.github.io/maimer/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Stanislas Mahussi Gandaho. Author, maintainer. Laboratory Applied Ecology, University Abomey-Calavi, Benin (LAE/UAC)","code":""},{"path":"https://stangandaho.github.io/maimer/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Gandaho S (2025). maimer: Handle Camera Trap Data. R package version 0.2.0, https://stangandaho.github.io/maimer/.","code":"@Manual{, title = {maimer: Handle Camera Trap Data}, author = {Stanislas Mahussi Gandaho}, year = {2025}, note = {R package version 0.2.0}, url = {https://stangandaho.github.io/maimer/}, }"},{"path":[]},{"path":"https://stangandaho.github.io/maimer/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Handle Camera Trap Data","text":"Camera traps essential tool wildlife monitoring ecological research. generate vast amounts data require careful processing, cleaning, analysis extract meaningful insights. Researchers use camera trap data tasks species identification, biodiversity assessment, activity pattern analysis, occupancy modeling. However, handling analyzing data can complex time-consuming.","code":""},{"path":"https://stangandaho.github.io/maimer/index.html","id":"the-need-for-simplification","dir":"","previous_headings":"","what":"The Need for Simplification","title":"Handle Camera Trap Data","text":"Processing analyzing camera trap data R often requires multiple steps, cleaning raw data statistical modeling visualization. maimer R package addresses challenges providing modern, tidyverse-friendly workflow camera trap data analysis. Using tidy evaluation principles, enables users efficiently manipulate transform datasets. Additionally, integrates seamlessly ggplot2, allowing users generate highly customizable visualizations.","code":""},{"path":"https://stangandaho.github.io/maimer/index.html","id":"key-features-of-maimer","dir":"","previous_headings":"","what":"Key Features of maimer","title":"Handle Camera Trap Data","text":"Data Management & Standardization: Functions like mm_read(), mm_standardize(), mm_stack_df() help streamline data preparation. Manage media files: functions mm_remove_hs(), mm_get_hs(), mm_create_hs(), mm_app(), etc help read write image metadata. Data Cleaning & Validation: Ensure data integrity mm_check_name(), mm_check_location(). Flexible Data Transformation: Convert raw camera trap data formats suited different analyses (mm_to_community(), mm_to_occupancy(), mm_to_time()). Diversity Metrics: Calculate alpha beta diversity mm_alpha_diversity() mm_dissimilarity(), etc. Species Activity Overlap: Estimate visualize species overlap using mm_overlap_estimates(), mm_overlap_matrix(), mm_plot_overlap(). Temporal Analysis: Explore species activity shifts time mm_temporal_shift(). current complete list functions .","code":""},{"path":"https://stangandaho.github.io/maimer/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation:","title":"Handle Camera Trap Data","text":"can install ‘maimer’ directly GitHub using following command:","code":"# Install devtools package if you haven't already if(!'remotes' %in% rownames(installed.packages())){ install.packages(\"remotes\") } # Install maimer from GitHub remotes::install_github(\"stangandaho/maimer\")"},{"path":"https://stangandaho.github.io/maimer/index.html","id":"meta","dir":"","previous_headings":"","what":"Meta","title":"Handle Camera Trap Data","text":"welcome contributions including bug reports. License: MIT Get citation information maimer R citation(\"maimer\"). Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate bootstrap estimates of overlap — mm_bootstrap","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"bootstrap takes two sets times observations calculates bootstrap estimates chosen estimator overlap. Alternatively, bootstrap estimates can calculated 2-stage process: (1) create matrix bootstrap samples data set, using mm_resample(); (2) pass matrices mm_boot_estimates() obtain bootstrap estimates. vector bootstrap estimates can used produce confidence intervals mm_boot_CI().","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"","code":"mm_bootstrap( A, B, nb, smooth = TRUE, kmax = 3, adjust = NA, n_grid = 128, type = c(\"Dhat1\", \"Dhat4\", \"Dhat5\"), cores = 1 ) mm_resample(x, nb, smooth = TRUE, kmax = 3, adjust = 1, n_grid = 512) mm_boot_estimates( Amat, Bmat, kmax = 3, adjust = c(0.8, 1, 4), n_grid = 128, type = c(\"all\", \"Dhat1\", \"Dhat4\", \"Dhat5\"), cores = 1 )"},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"numeric vector time--day observations (radians) species . B numeric vector time--day observations (radians) species B. nb number bootstrap samples required smooth TRUE, smoothed bootstrap samples produced. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. n_grid integer specifying number grid points density estimation. Default 128. type name estimator use, \"\" produce three estimates. See mm_overlap_estimates() recommendations use. cores number cores use parallel processing. NA, one available cores used. Parallel processing may take longer serial processing bootstrap runs quickly. x numeric vector time--capture data radians, ie. [0, \\(2\\pi\\)] scale Amat, Bmat matrices resampled data species produced resample; see Value .","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"function mm_bootstrap() returns vector bootstrap estimates. estimation fails bootstrap sample, corresponding value NA. function mm_resample() returns numeric matrix column corresponding bootstrap sample. Times radians. may return matrix NAs smooth = TRUE bandwidth estimation fails. Function mm_boot_estimates type = \"\" returns numeric matrix three columns, one estimator overlap, otherwise vector bootstrap estimates.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"Ridout & Linkie (2009) Estimating overlap daily activity patterns camera trap data. Journal Agricultural, Biological, Environmental Statistics 14:322-337","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"Mike Meredith, Martin Ridout.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/bootstrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate bootstrap estimates of overlap — mm_bootstrap","text":"","code":"# Generate random data for two species set.seed(42) species_A <- runif(100, 1.2, 2 * pi) species_B <- runif(100, 0.23, 2 * pi) est <- mm_overlap_estimates(species_A, species_B, type=\"Dhat4\") boots <- mm_bootstrap(species_A, species_B, 1000, type=\"Dhat4\", cores=1) mean(boots) #> [1] 0.8304592 hist(boots) mm_boot_CI(est, boots) #> lower upper #> norm 0.7975707 0.9708611 #> norm0 0.7706923 0.9439828 #> basic 0.8051838 0.9740576 #> basic0 0.7674959 0.9363697 #> perc 0.7406175 0.9094913 # alternatively: species_A_gen <- mm_resample(species_A, 1000) species_B_gen <- mm_resample(species_B, 1000) boots <- mm_boot_estimates(species_A_gen, species_B_gen, type=\"Dhat4\", cores=1) mean(boots) #> [1] 0.8338819"},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":null,"dir":"Reference","previous_headings":"","what":"Alpha diversity index — mm_alpha_diversity","title":"Alpha diversity index — mm_alpha_diversity","text":"Calculate index diversity within particular area ecosystem; usually expressed number species (.e., species richness) ecosystem.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alpha diversity index — mm_alpha_diversity","text":"","code":"mm_alpha_diversity( data, to_community = TRUE, index = \"shannon\", site_column, species_column, size_column = NULL, margin = 1 )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Alpha diversity index — mm_alpha_diversity","text":"data data frame containing species observation data. to_community Logical; TRUE, function first transforms data community matrix format sites rows species columns computing indices. Default TRUE. index character vector specifying diversity index calculate. Accepted values \"shannon\", \"simpson\", \"invsimpson\", \"evenness\", \"pielou\". Multiple indices can computed simultaneously providing vector. site_column column name data represents site location species recorded. species_column column(s) data representing species taxa. can single column name, range column indices (e.g., 2:5), selection helper (e.g., dplyr::starts_with(\"sp_\")). size_column (Optional) column data containing count abundance individuals per species. NULL, function assumes row represents one individual. margin integer specifying whether diversity calculations performed row (margin = 1) column (margin = 2). Default 1 (row-wise).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Alpha diversity index — mm_alpha_diversity","text":"tibble diversity index values site. first column corresponds site_column, followed one columns containing computed diversity indices, depending values specified index argument.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Alpha diversity index — mm_alpha_diversity","text":"Simpson diversity index Simpson (1949) introduced diversity index quantifies likelihood two randomly chosen individuals belonging species. probability increases diversity decreases; scenario diversity (one species), probability reaches 1. Simpson's Index computed using following formula: $$D = \\sum_{=1}^{S} \\left( \\frac{n_{}}{N} \\right)^2$$ \\(n_{}\\) number individuals species , N = total number individuals species, \\(\\frac{n_{}}{N} = pi\\) (proportion individuals species ), S = species richness. value Simpson’s D ranges 0 1, 0 representing infinite diversity 1 representing diversity, larger value D, lower diversity. reason, Simpson’s index often complement (1-D). Simpson's Dominance Index inverse Simpson's Index (\\(1/D\\)). Shannon-Weiner Diversity Index Shannon-Weiner Diversity Index measure diversity takes account species richness evenness, introduced Claude Shannon 1948. Commonly referred Shannon's Diversity Index, based concept uncertainty. instance, community low diversity, high level certainty (low uncertainty) identity randomly selected organism. Conversely, highly diverse community, uncertainty increases, making harder predict species randomly chosen organism belong (low certainty high uncertainty). $$H = -\\sum_{=1}^{S} p_{} * \\ln p_{}$$ \\(p_{}\\) = proportion individuals species , ln natural logarithm, S = species richness. value H ranges 0 Hmax. Hmax different community depends species richness. (Note: Shannon-Weiner often denoted H' ). Pielou Evenness diversity index Species evenness refers relative abundance species within environment. example, 40 foxes 1000 dogs, community uneven one species dominates. However, 40 foxes 42 dogs, community much even, species balanced number. degree evenness community can quantified using Pielou's evenness index (Pielou, 1966): $$J=\\frac{H}{H_{\\max }}$$ value J ranges 0 1. Higher values indicate higher levels evenness. maximum evenness, J = 1. J D can used measures species dominance (opposite diversity) community. Low J indicates 1 species dominate community.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Alpha diversity index — mm_alpha_diversity","text":"Pielou, E.C. (1966). measurement diversity different types biological collections. Journal Theoretical Biology, 13, pp. 131–144. doi:10.1016/0022-5193(66)90013-0. Simpson, E.H. (1949). Measurement diversity. Nature, 163, pp. 688. doi:10.1038/163688a0 Shannon, C.E. (1948). mathematical theory communication. Bell System Technical Journal, 27, pp. 379-423.https://doi.org/10.1002/j.1538-7305.1948.tb01338.x","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_alpha_diversity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Alpha diversity index — mm_alpha_diversity","text":"","code":"cam_data <- read.csv(system.file('penessoulou_season1.csv', package = 'maimer')) # Transform data to community format and compute diversity indices alpha1 <- cam_data %>% mm_alpha_diversity( to_community = TRUE, size_column = number, site_column = camera, species_column = species, index = c(\"shannon\", \"evenness\", \"invsimpson\") ) # Alternative method using a manually transformed community matrix alpha2 <- cam_data %>% mm_to_community(site_column = camera, species_column = species, size_column = number, values_fill = 0) %>% mm_alpha_diversity( to_community = FALSE, site_column = camera, species_column = 2:11, index = c(\"shannon\", \"evenness\", \"invsimpson\") ) alpha2 #> # A tibble: 13 × 4 #> camera shannon evenness invsimpson #> #> 1 CAMERA 10 0.103 0.045 1.04 #> 2 CAMERA 3 0.974 0.423 2.46 #> 3 CAMERA 5 0.893 0.388 2.18 #> 4 CAMERA 8 0.224 0.097 1.12 #> 5 CAMERA 2 0.509 0.221 1.34 #> 6 CAMERA 1 1.14 0.497 2.73 #> 7 CAMERA 12 0 0 1 #> 8 CAMERA 4 1.31 0.57 3.55 #> 9 CAMERA 11 0 0 1 #> 10 CAMERA 3 - Bait 0.562 0.244 1.6 #> 11 CAMERA 1 - Bait 0 0 1 #> 12 CAMERA 19 0.637 0.276 1.80 #> 13 FCPEN 0.131 0.057 1.06 # Compare results all(alpha1 == alpha2) # TRUE #> [1] TRUE"},{"path":"https://stangandaho.github.io/maimer/reference/mm_app.html","id":null,"dir":"Reference","previous_headings":"","what":"Run App — mm_app","title":"Run App — mm_app","text":"Launch maimer GUI image/video management","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_app.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run App — mm_app","text":"","code":"mm_app()"},{"path":"https://stangandaho.github.io/maimer/reference/mm_boot_CI.html","id":null,"dir":"Reference","previous_headings":"","what":"Bootstrap confidence intervals — mm_boot_CI","title":"Bootstrap confidence intervals — mm_boot_CI","text":"Confidence interval calculation bootstrap samples.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_boot_CI.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Bootstrap confidence intervals — mm_boot_CI","text":"","code":"mm_boot_CI(t0, bt, conf = 0.95)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_boot_CI.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Bootstrap confidence intervals — mm_boot_CI","text":"t0 statistic estimated original sample, usually output mm_overlap_estimates() bt vector bootstrap statistics, usually output mm_boot_estimates() conf (single!) confidence interval estimate.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":null,"dir":"Reference","previous_headings":"","what":"Interactive Camera Trap Location Adjustment — mm_check_location","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"function launches shiny application allows users visualize manually adjust geographic coordinates camera trap locations. Users can drag points interactive map update positions camera traps, updated dataset saved global environment.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"","code":"mm_check_location( data, longitude, latitude, location_name, coord_system = c(\"geographic\", \"projected\"), crs, new_data_name )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"data data frame containing camera trap data processed. longitude string representing column name longitude dataset. latitude string representing column name latitude dataset. location_name string representing column name location name unique identifier camera trap point. coord_system string specifying coordinate system input data. Choices \"geographic\" longitude latitude, \"projected\" projected coordinates. crs integer representing coordinate reference system (CRS) EPSG format. Required coord_system = \"projected\". new_data_name string specifying name new dataset updated coordinates created global environment.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_location.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Interactive Camera Trap Location Adjustment — mm_check_location","text":"shiny application launched display map allow manual coordinate adjustments. modified dataset saved global environment name provided new_data_name.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"function queries Integrated Taxonomic Information System (ITIS) find taxonomic details given species name. can search using either scientific name common name return relevant taxonomic information, including TSN.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"","code":"mm_check_name(species_name, search_type, ask = FALSE)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"species_name character string specifying species name search . single name allowed. search_type character string specifying type search. Options: \"sientific_name\": Search scientific name. \"common_name\": Search common name. ask logical value (TRUE FALSE). TRUE, allows interactive selection multiple matches found.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"tibble containing taxonomic details: search: original species name queried. tsn: Taxonomic Serial Number (TSN) ITIS. common_name: common name species (available). scientific_name: scientific name species. author: author classified species. itis_url: direct link species report ITIS. taxon_status: taxonomic status species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"necessary packages (httr2, xml2) installed, function prompts user install . multiple results found ask = TRUE, user prompted select correct match. exact match found, results displayed manual selection.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_check_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check species name and retrieve Taxonomic Serial Number (TSN) from ITIS — mm_check_name","text":"","code":"if (FALSE) { # \\dontrun{ # Search for a species by scientific name mm_check_name(\"Panthera leo\", search_type = \"sientific_name\") # Search by common name with interactive selection mm_check_name(\"Lion\", search_type = \"common_name\", ask = TRUE) } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":null,"dir":"Reference","previous_headings":"","what":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"Create Add Hierarchical Subject Values Image Metadata","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"","code":"mm_create_hs(path, value = c(), intern = TRUE, quiet = TRUE, ...)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"path character vector specifying full path image file. value named character vector specifying new hierarchical subjects add. value must parent specified name, e.g c(\"Species\" = \"Vulture\"). intern TRUE output returned character vector. quiet Suppress output command . ... additional arguments passed system2()","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_create_hs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create or Add Hierarchical Subject Values in Image Metadata — mm_create_hs","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Get Hierarchical Subject from the image - Before use mm_create_hs() mm_get_hs(path = image_path) #==> NULL #> [1] \"Species|Vulture\" mm_create_hs(path = image_path, value = c(\"Species\" = \"Vulture\")) #> Warning: error in running command #> [1] # Get Hierarchical Subject from the image - Before use mm_create_hs() mm_get_hs(path = image_path) #==> \"Species|Vulture\" #> [1] \"Species|Vulture\""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate dissimilarity between communities — mm_dissimilarity","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"function computes dissimilarity indices useful popular community ecologists. indices use quantitative data, although named corresponding binary index, can calculate binary index using appropriate argument. find favourite index , can see can implemented using designdist. Gower, Bray–Curtis, Jaccard Kulczynski indices good detecting underlying ecological gradients (Faith et al. 1987). Morisita, Horn–Morisita, Binomial, Cao Chao indices able handle different sample sizes (Wolda 1981, Krebs 1999, Anderson & Millar 2004), Mountford (1962) Raup-Crick indices presence–absence data able handle unknown (variable) sample sizes. indices discussed Krebs (1999) Legendre & Legendre (2012), properties compared Wolda (1981) Legendre & De Cáceres (2012). Aitchison (1986) distance equivalent Euclidean distance CLR-transformed samples (\"clr\") deals positive compositional data. Robust Aitchison distance Martino et al. (2019) uses robust CLR (\"rlcr\"), making applicable non-negative data including zeroes (unlike standard Aitchison).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"","code":"mm_dissimilarity( data, to_community = FALSE, site_column, species_column, size_column = NULL, method = \"bray\", binary = FALSE, diag = FALSE, upper = FALSE, na.rm = FALSE, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"data data frame matrix containing species abundance data. rows represent sites (samples), columns represent species. data can raw transformed format (to_community = TRUE). to_community logical indicating whether input data transformed community data (site row species column). Default FALSE. site_column name column representing site/sample identifiers (used to_community = TRUE). species_column name column representing species identifiers (used to_community = TRUE). size_column name column representing size abundance counts species site (optional, used to_community = TRUE). method character string indicating distance measure use calculating beta diversity. available methods : \"manhattan\", \"euclidean\", \"canberra\", \"bray\", \"kulczynski\", \"gower\", \"morisita\", \"horn\", \"mountford\", \"jaccard\", \"raup\", \"binomial\", \"chao\", \"altGower\", \"cao\", \"mahalanobis\", \"clark\", \"chisq\", \"chord\", \"hellinger\", \"aitchison\", \"robust.aitchison\". default \"bray\". binary logical indicating whether transform data presence/absence (binary data) calculating dissimilarities. Default FALSE. diag logical indicating whether include diagonal output dissimilarity matrix. Default FALSE (diagonal values omitted). upper logical indicating whether return upper triangular part dissimilarity matrix. Default FALSE. na.rm logical indicating whether remove NA values data calculating dissimilarities. Default FALSE. FALSE, error raised missing values data. ... Additional arguments passed functions, transformation functions data scaling standardization.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"distance matrix (class dist) containing pairwise dissimilarities sites. dissimilarities calculated according chosen distance metric, various attributes (e.g., method, size, labels) attached result.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"Jaccard (\"jaccard\"), Mountford (\"mountford\"), Raup–Crick (\"raup\"), Binomial Chao indices discussed later section. function also finds indices presence/ absence data setting binary = TRUE. following overview gives first quantitative version, \\(x_{ij}\\) \\(x_{ik}\\) refer quantity species (column) \\(\\) sites (rows) \\(j\\) \\(k\\). binary versions \\(\\) \\(B\\) numbers species compared sites, \\(J\\) number species occur compared sites similarly designdist (many indices produce identical binary versions): Jaccard index computed \\(2B/(1+B)\\), \\(B\\) Bray–Curtis dissimilarity. Binomial index derived Binomial deviance null hypothesis two compared communities equal. able handle variable sample sizes. index fixed upper limit, can vary among sites shared species. discussion, see Anderson & Millar (2004). Cao index CYd index (Cao et al. 1997) suggested minimally biased index high beta diversity variable sampling intensity. Cao index fixed upper limit, can vary among sites shared species. index intended count (integer) data, undefined zero abundances; replaced arbitrary value \\(0.1\\) following Cao et al. (1997). Cao et al. (1997) used \\(\\log_{10}\\), current function uses natural logarithms values approximately \\(2.30\\) times higher 10-based logarithms. Anderson & Thompson (2004) give alternative formulation Cao index highlight relationship Binomial index (). Mountford index defined \\(M = 1/\\alpha\\) \\(\\alpha\\) parameter Fisher's logseries assuming compared communities samples community (cf. fisherfit, fisher.alpha). index \\(M\\) found positive root equation \\(\\exp() + \\exp(bM) = 1 + \\exp[(+b-j)M]\\), \\(j\\) number species occurring communities, \\(\\) \\(b\\) number species separate community (index uses presence–absence information). Mountford index usually misrepresented literature: indeed Mountford (1962) suggested approximation used starting value iterations, proper index defined root equation . function vegdist solves \\(M\\) Newton method. Please note either \\(\\) \\(b\\) equal \\(j\\), one communities subset , dissimilarity \\(0\\) meaning non-identical objects may regarded similar index non-metric. Mountford index range \\(0 \\dots \\log(2)\\). Raup–Crick dissimilarity (method = \"raup\") probabilistic index based presence/absence data. defined \\(1 - prob(j)\\), based probability observing least \\(j\\) species shared compared communities. current function uses analytic result hypergeometric distribution (phyper) find probabilities. probability (index) dependent number species missing sites, adding -zero species data removing missing species data influence index. probability ( index) may almost zero almost one wide range parameter values. index nonmetric: two communities shared species may dissimilarity slightly one, two identical communities may dissimilarity slightly zero. index uses equal occurrence probabilities species, Raup Crick originally suggested sampling probabilities proportional species frequencies (Chase et al. 2011). simulation approach unequal species sampling probabilities implemented raupcrick function following Chase et al. (2011). index can also used transposed data give probabilistic dissimilarity index species co-occurrence (identical Veech 2013). Chao index tries take account number unseen species pairs, similarly method = \"chao\" specpool. Function vegdist implements Jaccard, index defined \\(1-\\frac{U \\times V}{U + V - U \\times V}\\); types can defined function chaodist. Chao equation, \\(U = C_j/N_j + (N_k - 1)/N_k \\times a_1/(2 a_2) \\times S_j/N_j\\), \\(V\\) similar except site index \\(k\\). \\(C_j\\) total number individuals species site \\(j\\) shared site \\(k\\), \\(N_j\\) total number individuals site \\(j\\), \\(a_1\\) (\\(a_2\\)) number species occurring site \\(j\\) one (two) individuals site \\(k\\), \\(S_j\\) total number individuals species present site \\(j\\) occur one individual site \\(k\\) (Chao et al. 2005). Morisita index can used genuine count data (integers) . Horn–Morisita variant able handle abundance data. Mahalanobis distances Euclidean distances matrix columns centred, unit variance, uncorrelated. index commonly used community data, sometimes used environmental variables. calculation based transforming data matrix using Euclidean distances following Mardia et al. (1979). Mahalanobis transformation usually fails number columns larger number rows (sampling units). transformation fails, distances nearly constant except small numeric noise. Users must check returned Mahalanobis distances meaningful. Euclidean Manhattan dissimilarities good gradient separation without proper standardization still included comparison special needs. Chi-square distances (\"chisq\") Euclidean distances Chi-square transformed data (see decostand). internal standardization used correspondence analysis (cca, decorana). Weighted principal coordinates analysis distances row sums weights equal correspondence analysis (see Example wcmdscale). Chi-square distance intended non-negative data, typical community data. However, can calculated long margin sums positive, warning issued negative data entries. Chord distances (\"chord\") Euclidean distance matrix rows standardized unit norm (sums squares 1) using decostand. Geometrically standardization moves row points surface multidimensional unit sphere, distances chords across hypersphere. Hellinger distances (\"hellinger\") related Chord distances, data standardized unit total (row sums 1) using decostand, square root transformed. distances upper limit \\(\\sqrt{2}\\). Bray–Curtis Jaccard indices rank-order similar, indices become identical rank-order similar standardizations, especially presence/absence transformation equalizing site totals decostand. Jaccard index metric, probably preferred instead default Bray-Curtis semimetric. Aitchison distance (1986) robust Aitchison distance (Martino et al. 2019) metrics deal compositional data. Aitchison distance said outperform Jensen-Shannon divergence Bray-Curtis dissimilarity, due better stability subsetting aggregation, proper distance (Aitchison et al., 2000). naming conventions vary. one adopted traditional rather truthful priority. function finds either quantitative binary variants indices name, correctly may refer one alternatives instance, Bray index known also Steinhaus, Czekanowski Sørensen index. quantitative version Jaccard probably called Ružička index. abbreviation \"horn\" Horn–Morisita index misleading, since separate Horn index. abbreviation changed index implemented vegan.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"function alternative dist adding ecologically meaningful indices. methods produce similar types objects can interchanged method accepting either. Manhattan Euclidean dissimilarities identical methods. Canberra index divided number variables vegdist, dist. differ constant multiplier, alternative vegdist range (0,1). Function daisy (package cluster) provides alternative implementation Gower index also can handle mixed data numeric class variables. two versions Gower distance (\"gower\", \"altGower\") differ scaling: \"gower\" divides distances number observations (rows) scales column unit range, \"altGower\" omits double-zeros divides number pairs least one -zero value, scale columns (Anderson et al. 2006). can use decostand add range standardization \"altGower\" (see Examples). Gower (1971) suggested omitting double zeros presences, often taken general feature Gower distances. See Examples implementing Anderson et al. (2006) variant Gower index. dissimilarity indices vegdist designed community data, give misleading values negative data entries. results may also misleading NA NaN empty sites. principle, study species composition without species remove empty sites community data.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"Aitchison, J. Statistical Analysis Compositional Data (1986). London, UK: Chapman & Hall. Aitchison, J., Barceló-Vidal, C., Martín-Fernández, J.., Pawlowsky-Glahn, V. (2000). Logratio analysis compositional distance. Math. Geol. 32, 271–275. Anderson, M.J. Millar, R.B. (2004). Spatial variation effects habitat temperate reef fish assemblages northeastern New Zealand. Journal Experimental Marine Biology Ecology 305, 191–221. Anderson, M.J., Ellingsen, K.E. & McArdle, B.H. (2006). Multivariate dispersion measure beta diversity. Ecology Letters 9, 683–693. Anderson, M.J & Thompson, .. (2004). Multivariate control charts ecological environmental monitoring. Ecological Applications 14, 1921–1935. Cao, Y., Williams, W.P. & Bark, .W. (1997). Similarity measure bias river benthic Auswuchs community analysis. Water Environment Research 69, 95–106. Chao, ., Chazdon, R. L., Colwell, R. K. Shen, T. (2005). new statistical approach assessing similarity species composition incidence abundance data. Ecology Letters 8, 148–159. Chase, J.M., Kraft, N.J.B., Smith, K.G., Vellend, M. Inouye, B.D. (2011). Using null models disentangle variation community dissimilarity variation \\(\\alpha\\)-diversity. Ecosphere 2:art24 doi:10.1890/ES10-00117.1 Faith, D. P, Minchin, P. R. Belbin, L. (1987). Compositional dissimilarity robust measure ecological distance. Vegetatio 69, 57–68. Gower, J. C. (1971). general coefficient similarity properties. Biometrics 27, 623–637. Krebs, C. J. (1999). Ecological Methodology. Addison Wesley Longman. Legendre, P. & De Cáceres, M. (2012). Beta diversity variance community data: dissimilarity coefficients partitioning. Ecology Letters 16, 951–963. doi:10.1111/ele.12141 Legendre, P. Legendre, L. (2012) Numerical Ecology. 3rd English ed. Elsevier. Mardia, K.V., Kent, J.T. Bibby, J.M. (1979). Multivariate analysis. Academic Press. Martino, C., Morton, J.T., Marotz, C.., Thompson, L.R., Tripathi, ., Knight, R. & Zengler, K. (2019) novel sparse compositional technique reveals microbial perturbations. mSystems 4, 1. Mountford, M. D. (1962). index similarity application classification problems. : P.W.Murphy (ed.), Progress Soil Zoology, 43–50. Butterworths. Veech, J. . (2013). probabilistic model analysing species co-occurrence. Global Ecology Biogeography 22, 252–260. Wolda, H. (1981). Similarity indices, sample size diversity. Oecologia 50, 296–302.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_dissimilarity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate dissimilarity between communities — mm_dissimilarity","text":"Jari Oksanen, contributions Tyler Smith (Gower index), Michael Bedward (Raup–Crick index), Leo Lahti (Aitchison robust Aitchison distance).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"function retrieves values Hierarchical Subject field image's metadata. uses exiftool read metadata processes results extract return unique hierarchical subjects.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"","code":"mm_get_hs(path)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"path character vector specifying full path image file.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"character vector unique hierarchical subjects exist, otherwise NULL.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_hs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Retrieve Hierarchical Subject Values from Image Metadata — mm_get_hs","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Get Hierarchical Subject from the image mm_get_hs(path = image_path) #> [1] \"Species|Vulture\""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract image metadata — mm_get_metadata","title":"Extract image metadata — mm_get_metadata","text":"function extracts metadata image files located specified path. function can handle individual image files directories containing multiple images. uses exiftool utility read metadata can optionally save extracted metadata CSV file.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract image metadata — mm_get_metadata","text":"","code":"mm_get_metadata(path, recursive = FALSE, save_file = FALSE, file_name = \"\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract image metadata — mm_get_metadata","text":"path character vector full path names. Either directory path file path. path specified directory, function looks image (.jpeg/JPEG, jpg/JPG) inside extract tags bind single data.frame. recursive logical. listing recurse directories? applied path directory. save_file logical. Extracted metadata write disk? file_name character specifying name file save csv format. left empty save_file TRUE, default name metadata.csv. Note file saved save_file FALSE, even file name provided.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract image metadata — mm_get_metadata","text":"data.frame","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_get_metadata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract image metadata — mm_get_metadata","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Extract metadata from the downloaded image metadata <- mm_get_metadata(path = image_path) # Extract metadata from all images in a directory (non-recursive) file.copy(image_path, file.path(dirname(image_path), \"large2.jpeg\")) #> [1] TRUE metadata_dir <- mm_get_metadata(path = dirname(image_path), recursive = FALSE) #> Processing image large.jpeg (1 of 2) #> Processing image large2.jpeg (2 of 2) unlink(file.path(dirname(image_path), \"large2.jpeg\"))"},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate Event Independence — mm_independence","title":"Evaluate Event Independence — mm_independence","text":"function calculates difference times evaluates whether events independent based given threshold. useful checking certain events dataset independent based time intervals.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate Event Independence — mm_independence","text":"","code":"mm_independence( data = NULL, species_column = NULL, datetime, format, threshold = 30 * 60, only = FALSE )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate Event Independence — mm_independence","text":"data data.frame, tbl_df, tbl containing event data. include column datetime values. NULL, function use deltatime argument instead data argument. species_column optional column name specifying species grouping. provided, independence assessed separately within species group. datetime character string specifying name column data contains datetime values. argument required data provided. format character string defining format used parse datetime values datetime column. threshold numeric value representing time difference threshold (seconds) determine whether events independent. Events considered independent time difference greater equal threshold. default 30 minutes (1800 seconds). logical value indicating whether return rows data identified independent events. TRUE, independent events returned. FALSE, entire data frame returned additional column indicating independence status. default TRUE.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate Event Independence — mm_independence","text":"data provided TRUE, tibble events identified independent. data provided FALSE, tibble original data additional columns indicating independent status deltatime differences. data provided, tibble deltatime values independent status.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_independence.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate Event Independence — mm_independence","text":"","code":"library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union # Load example dataset cam_data <- read.csv(system.file(\"penessoulou_season1.csv\", package = \"maimer\")) # Independence without considering species occurrence indep1 <- cam_data %>% mm_independence(data = ., datetime = datetimes, format = \"%Y-%m-%d %H:%M:%S\", only = TRUE) sprintf(\"Independent observations: %s\", nrow(indep1)) #> [1] \"Independent observations: 177\" # Independence considering species occurrence indep2 <- cam_data %>% mm_independence(data = ., datetime = datetimes, format = \"%Y-%m-%d %H:%M:%S\", only = TRUE, species_column = \"species\") sprintf(\"Independent observations: %s\", nrow(indep2)) #> [1] \"Independent observations: 183\" # Use a standalone vector of datetime values dtime <- cam_data$datetimes mm_independence(datetime = dtime, format = \"%Y-%m-%d %H:%M:%S\", only = TRUE) #> # A tibble: 177 × 1 #> datetime #> #> 1 2019-01-20 15:24:41 #> 2 2019-01-21 15:23:38 #> 3 2019-01-23 15:35:20 #> 4 2019-01-24 06:01:07 #> 5 2023-09-20 16:15:28 #> 6 2023-09-21 13:32:45 #> 7 2024-03-02 22:32:10 #> 8 2024-03-10 10:21:56 #> 9 2024-03-10 15:04:38 #> 10 2024-03-10 17:28:11 #> # ℹ 167 more rows"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimates of coefficient of overlapping — mm_overlap_estimates","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"Estimates coefficient overlapping","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"","code":"mm_overlap_estimates( A, B, kmax = 3, adjust = c(0.8, 1, 4), n_grid = 128, type = c(\"all\", \"Dhat1\", \"Dhat4\", \"Dhat5\") )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"numeric vector time--day observations (radians) species . B numeric vector time--day observations (radians) species B. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. n_grid integer specifying number grid points density estimation. Default 128. type name estimator use: Dhat4 recommended samples larger 50, otherwise use Dhat1. See Details. default \"\" compatibility older versions.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"See overlapTrue meaning coefficient overlapping, \\(\\Delta\\). estimators \\(\\Delta\\) use kernel density estimates fitted data approximate true density functions f(t) g(t). Schmid & Schmidt (2006) propose five estimators overlap: Dhat1 calculated vectors densities estimated T equally-spaced times, t, 0 \\(2\\pi\\): circular distributions, Dhat2 equivalent Dhat1, Dhat3 inapplicable. Dhat4 Dhat5 use vectors densities estimated times observations species, x y: n, m sample sizes indicator function (1 condition true, 0 otherwise). Dhat5 simply checks curve higher point; even tiny changes data can result large, discontinuous changes Dhat5, can take values > 1. use Dhat5. Comparing curves times actual observations works well enough observations species. Simulations show Dhat4 best smallest sample least 50 observations. Dhat1 compares curves n.grid equally spaced points, best small samples.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_estimates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimates of coefficient of overlapping — mm_overlap_estimates","text":"","code":"set.seed(42) species_A <- runif(100, 1.2, 2 * pi) species_B <- runif(100, 0.23, 2 * pi) mm_overlap_estimates(species_A, species_B) #> Dhat1 Dhat4 Dhat5 #> 0.8579292 0.8573376 0.8400000 mm_overlap_estimates(species_A, species_B, type = \"Dhat4\") #> Dhat4 #> 0.8573376"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"function calculates pairwise overlap coefficients activity patterns multiple species using time data.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"","code":"mm_overlap_matrix( data, species_column, time_column, convert_time = F, format = \"%H:%M:%S\", fill_na = NULL, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"data data.frame tibble containing species time information. species_column column data indicating species names. time_column column data containing time data (either radians time format converted). convert_time Logical. TRUE, time data converted radians using mm_to_radian function. format character string specifying time format (e.g., \"%H:%M:%S\") mm_to_radian() TRUE. Defaults \"%H:%M:%S\". fill_na Optional. numeric value used fill NA values overlap coefficient matrix. Defaults NULL (fill NA values). ... Additional arguments passed overlap::overlapEst()` overlap estimation.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"square matrix pairwise overlap coefficients, rows columns represent species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"function calculates pairwise overlap coefficients species dataset. overlap coefficients estimated using overlap package: species pairs sample sizes least 50 observations , Dhat4 estimator used. smaller sample sizes, Dhat1 estimator used (Schmid & Schmidt, 2006).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"Schmid & Schmidt (2006) Nonparametric estimation coefficient overlapping - theory empirical application, Computational Statistics Data Analysis, 50:1583-1596.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_overlap_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Overlap Coefficients for Multiple Species — mm_overlap_matrix","text":"","code":"# Example dataset data <- data.frame( species = c(\"SpeciesA\", \"SpeciesA\", \"SpeciesB\", \"SpeciesB\"), time = c(\"10:30:00\", \"11:45:00\", \"22:15:00\", \"23:30:00\") ) # Calculate overlap coefficients with time conversion overlap_matrix <- mm_overlap_matrix( data = data, species_column = species, time_column = time, convert_time = TRUE, format = \"%H:%M:%S\" ) # Fill missing values in the matrix with 0 overlap_matrix_filled <- mm_overlap_matrix( data = data, species_column = species, time_column = time, convert_time = TRUE, fill_na = 0 )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot species' activity patterns — mm_plot_density","title":"Plot species' activity patterns — mm_plot_density","text":"function visualizes species' activity patterns based time--day data. uses kernel density estimation estimate activity density.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot species' activity patterns — mm_plot_density","text":"","code":"mm_plot_density( time, xscale = 24, xcenter = c(\"noon\", \"midnight\"), n_grid = 128, kmax = 3, adjust = 1, rug = FALSE, linetype = 2, linecol = \"gray10\", linewidth = 1, rug_lentgh = 0.018, rug_color = \"gray30\", extend = \"lightgrey\", extend_alpha = 0.8, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot species' activity patterns — mm_plot_density","text":"time numeric vector time--day observations (radians, 0 \\(2\\pi\\)). xscale numeric value scale x-axis. Default 24 representing time hours. xcenter string indicating center x-axis. Options \"noon\" (default) \"midnight\". n_grid integer specifying number grid points density estimation. Default 128. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. rug logical value indicating whether include rug plot observations. Default FALSE. linetype numeric specifying line types. Default c(1, 2). linecol string specifying colors density lines species B. Default c(\"gray10\", \"gray0\"). linewidth numeric value specifying line widths species B density lines. Default c(1, 1). rug_lentgh numeric value specifying length rug ticks. Default 0.018 (normalized plot coordinates). rug_color string specifying color rug ticks. Default \"gray30\". extend string specifying color extended area beyond activity period. Default \"lightgrey\". extend_alpha numeric value (0 1) transparency extended area. Default 0.8. ... Additional arguments passed geom_rug function.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot species' activity patterns — mm_plot_density","text":"ggplot object representing activity density curves species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_density.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot species' activity patterns — mm_plot_density","text":"","code":"if (FALSE) { # \\dontrun{ # Generate random data for two species set.seed(42) A <- runif(100, 0, 2 * pi) # Plot overlap with default settings mm_plot_density(A) # Customize plot with specific colors and line types mm_plot_density(A, linecol = \"gray10\", linewidth = 0.8, xcenter = \"midnight\", rug = T, rug_color = 'red', extend_alpha = 0) } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot overlap between two species' activity patterns — mm_plot_overlap","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"function visualizes temporal overlap two species' activity patterns based time--day data. uses kernel density estimation estimate activity densities highlights areas overlap two species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"","code":"mm_plot_overlap( A, B, xscale = 24, xcenter = c(\"noon\", \"midnight\"), n_grid = 128, kmax = 3, adjust = 1, rug = FALSE, overlap_color = \"gray40\", overlap_alpha = 0.8, linetype = c(1, 2), linecol = c(\"gray10\", \"gray0\"), linewidth = c(1, 1), overlap_only = FALSE, rug_lentgh = 0.018, rug_color = \"gray30\", extend = \"lightgrey\", extend_alpha = 0.8, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"numeric vector time--day observations (radians) species . B numeric vector time--day observations (radians) species B. xscale numeric value scale x-axis. Default 24 representing time hours. xcenter string indicating center x-axis. Options \"noon\" (default) \"midnight\". n_grid integer specifying number grid points density estimation. Default 128. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. rug logical value indicating whether include rug plot observations. Default FALSE. overlap_color string specifying color overlap area. Default \"gray40\". overlap_alpha numeric value (0 1) transparency overlap area. Default 0.8. linetype vector integers specifying line types species B density lines. Default c(1, 2). linecol vector strings specifying colors density lines species B. Default c(\"gray10\", \"gray0\"). linewidth vector numeric values specifying line widths species B density lines. Default c(1, 1). overlap_only logical value indicating whether plot overlap region without individual density lines. Default FALSE. rug_lentgh numeric value specifying length rug ticks. Default 0.018 (normalized plot coordinates). rug_color string specifying color rug ticks. Default \"gray30\". extend string specifying color extended area beyond activity period. Default \"lightgrey\". extend_alpha numeric value (0 1) transparency extended area. Default 0.8. ... Additional arguments passed geom_rug function.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"ggplot object representing activity density curves overlap two species. overlap_only = TRUE, overlap region displayed.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"function calculates kernel density estimates two sets time--day data (B) visualizes overlap. time--day data expressed radians (0 2π). Key features plot: x-axis can scaled represent hours (default xscale = 24) units. center x-axis can adjusted \"noon\" \"midnight\". shaded polygon highlights overlap region two density curves. Optionally includes rug plot indicate raw observations. Allows customization line types, colors, widths, transparency. Extended regions (beyond primary activity period) can highlighted clarity.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot overlap between two species' activity patterns — mm_plot_overlap","text":"","code":"if (FALSE) { # \\dontrun{ # Generate random data for two species set.seed(42) species_A <- runif(100, 0, 2 * pi) species_B <- runif(100, 0, 2 * pi) # Plot overlap with default settings mm_plot_overlap(A = species_A, B = species_B) # Customize plot with specific colors and line types mm_plot_overlap(A = species_A, B = species_B, overlap_color = \"blue\", linecol = c(\"red\", \"green\")) # Include rug plots and change transparency mm_plot_overlap(A = species_A, B = species_B, rug = TRUE, overlap_alpha = 0.5) } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"Visualizes overlap coefficient matrix.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"","code":"mm_plot_overlap_coef( data, side = c(\"lower\", \"upper\"), show = c(\"shape\", \"value\"), shape_type = 21, shape_size = 0.5, text_size = 6, text_font = NA, excludes = NULL, color_scale = \"gray3\", ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"data square matrix (e.g mm_overlap_matrix() output) representing overlap coefficients visualized. side character string indicating triangle matrix display. Options \"lower\" (default) \"upper\". show character string specifying whether display \"shape\" (default) \"value\" plot. shape_type Numeric value specifying type shape use plot. Defaults 21 (circle). shape_size Numeric value controlling stroke size shapes. Defaults 0.5. text_size Numeric value specifying size text show = \"value\". Defaults 6. text_font Character string specifying font family use text labels. Defaults NA. excludes vector numeric values exclude plot. Defaults NULL. color_scale character string vector colors define gradient color scale. Defaults \"gray3\". ... Additional arguments passed guide_colorbar function.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"ggplot object representing overlap coefficient matrix visualization.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_plot_overlap_coef.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Overlap Coefficient Matrix — mm_plot_overlap_coef","text":"","code":"library(ggplot2) # Example overlap coefficient matrix overlap_matrix <- matrix(c(1, 0.8, 0.7, 0.8, 1, 0.9, 0.7, 0.9, 1), ncol = 3) colnames(overlap_matrix) <- rownames(overlap_matrix) <- c(\"A\", \"B\", \"C\") # Plot lower triangle with shapes mm_plot_overlap_coef(overlap_matrix, side = \"lower\", show = \"shape\") # Plot upper triangle with values mm_plot_overlap_coef(overlap_matrix, side = \"upper\", show = \"value\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a Delimited File into a Tibble — mm_read","title":"Read a Delimited File into a Tibble — mm_read","text":"mm_read function reads delimited text file. automatically detects delimiter specified provides easy--use interface importing data additional customization options.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a Delimited File into a Tibble — mm_read","text":"","code":"mm_read(file_path, header = TRUE, sep, ...)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a Delimited File into a Tibble — mm_read","text":"file_path string specifying path file read. header logical value indicating whether file contains header row. Defaults TRUE. sep field separator character. provided, function automatically detects separator. ... Additional arguments passed read.table function fine-tuned control file reading.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a Delimited File into a Tibble — mm_read","text":"tibble containing data specified file.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"mm_remove_hs function removes specific hierarchy Hierarchical Subject field image's metadata, removes entire field specific hierarchy provided. uses exiftool manipulate metadata ensure desired changes applied.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"","code":"mm_remove_hs(path, hierarchy = NULL, intern = TRUE, quiet = TRUE, ...)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"path character vector specifying full path image file. hierarchy named character vector, e.g c(\"Species\" = \"Vulture\") specifying hierarchy removed. NULL, entire Hierarchical Subject field removed. intern TRUE output returned character vector. quiet Suppress output command . ... additional arguments passed system2()","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"message indicating image updated","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_remove_hs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove Specific or All HierarchicalSubject Values from Image Metadata — mm_remove_hs","text":"","code":"# Image path image_path <- file.path(system.file(\"img\", package = \"maimer\"), \"large.jpeg\") # Get Hierarchical Subject from the image no_hs <- mm_get_hs(path = image_path) mm_create_hs(image_path, c(\"A\" = \"AB\")) #> Warning: error in running command #> [1] mm_remove_hs(image_path, c(\"A\" = \"AB\")) #> [1] Hierarchy A|AB does not exist. No change applied to large.jpeg"},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"function calculates Observed Spatial Coverage species like Home Range, based camera trap data. term home range typically associated dynamic movement data, recorded radio-tracking GPS devices, provide continuous near-continuous tracking individual animal's movements. Since camera traps static capture presence/absence activity within specific locations, concept home range might fully apply.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"","code":"mm_spatial_coverage( data, site_column, size_column = NULL, longitude, latitude, crs = c(4326, NULL), study_area = NULL, resolution, spread_factor = 0.1 )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"data data frame containing species occurrence records, including site, longitude, latitude, optionally size (abundance). site_column Column name specifying site identifier. size_column Optional column specifying abundance species site. Defaults NULL, case counts per site used. longitude Column name specifying longitude observation sites. latitude Column name specifying latitude observation sites. crs vector length two specifying coordinate reference systems: c(crs1, crs2). crs1 represents current CRS data (e.g., 4326 latitude/longitude). crs2 represents CRS transform (e.g., \"EPSG:32631\", UTM EPSG code) accurate distance calculations. crs2 NULL, transformation applied. Defaults c(4326, NULL) study_area optional simple feature (sf) polygon representing study area. provided, raster extends cover area. resolution Numeric value specifying spatial resolution (grid size) rasterization. spread_factor scale factor half-normal distribution. Higher values create spread-distribution, lower values make concentrated. value must ]0; 1]","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"list containing: Coverage raster: raster object representing species abundance across space. Coverage stats: tibble spatial coverage statistics, including area (km²), average abundance, maximum abundance, standard deviation.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"function applies half-normal kernel model species abundance space, using scale rate control spread distribution: $$\\bar{K}(x) = \\frac{\\sum w * \\text{e}^{(-0.5 * (\\frac{x}{\\sigma})^2)}}{N}$$ : \\(\\bar{K}(x)\\) mean abundance kernel across sites, \\(w\\) species abundance site, \\(\\sigma\\) standard deviation spatial distance (scaled spread_factor), \\(N\\) total number sites.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_spatial_coverage.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate Observed Spatial Coverage of Species — mm_spatial_coverage","text":"","code":"library(dplyr) cam_data <- system.file(\"penessoulou_season2.csv\", package = \"maimer\") %>% read.csv() %>% dplyr::filter(Species == \"Erythrocebus patas\") spc <- mm_spatial_coverage( data = cam_data, site_column = Camera, crs = \"EPSG:32631\", , resolution = 30, spread_factor = 0.4, size_column = Count, longitude = Longitude, latitude = Latitude ) ## Abundance stats spc[[2]] %>% dplyr::select(-1) #> # A tibble: 1 × 4 #> `Spatial coverage (km²)` `Average abundance` `Maximum abundance` #> #> 1 22.6 7 13 #> # ℹ 1 more variable: `Standard Deviation` ## Plot spatial coverage library(ggplot2) spc_vect <- terra::as.polygons(spc[[1]]) %>% sf::st_as_sf() ggplot() + geom_sf(data = spc_vect, aes(fill = Abundance), color = NA) + theme_minimal() + scale_fill_viridis_c()"},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Stack a list of data frame — mm_stack_df","title":"Stack a list of data frame — mm_stack_df","text":"function takes list data frames stacks single data frame. ensures columns input data frames list included output, filling missing columns NA values necessary.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack a list of data frame — mm_stack_df","text":"","code":"mm_stack_df(df_list)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack a list of data frame — mm_stack_df","text":"df_list list data frame stacked","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Stack a list of data frame — mm_stack_df","text":"data frame","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_stack_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Stack a list of data frame — mm_stack_df","text":"","code":"x <- data.frame(age = 15, fruit = \"Apple\", weight = 12) y <- data.frame(age = 51, fruit = \"Tomato\") z <- data.frame(age = 26, fruit = \"Lemo\", weight = 12, height = 45) alldf <- list(x,y,z) mm_stack_df(alldf) #> # A tibble: 3 × 4 #> age fruit weight height #> #> 1 15 Apple 12 NA #> 2 51 Tomato NA NA #> 3 26 Lemo 12 45"},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":null,"dir":"Reference","previous_headings":"","what":"Standardize community data matrix — mm_standardize","title":"Standardize community data matrix — mm_standardize","text":"function standardizes given data matrix using different methods total sum scaling, max normalization, frequency scaling, standardization, presence-absence transformation, chi-square transformation, Hellinger transformation, log transformation, others.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Standardize community data matrix — mm_standardize","text":"","code":"mm_standardize( data, method, margin, range_global, logbase = 2, na.rm = FALSE, ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Standardize community data matrix — mm_standardize","text":"data numeric matrix data frame standardized. method character string specifying standardization method (see details). Available methods : \"total\": Divides entry total sum given margin. \"max\": Divides entry maximum value given margin. \"frequency\": Frequency transformation. \"normalize\": Normalization Euclidean norm. \"range\": Standardizes range (min-max scaling). \"rank\": Converts values ranks. \"rrank\": Relative rank transformation. \"standardize\": Standardization (z-score normalization). \"pa\": Presence-absence transformation (binary). \"chi.square\": Chi-square standardization. \"hellinger\": Hellinger transformation. \"log\": Log transformation. \"clr\": Centered log-ratio transformation. \"rclr\": Robust centered log-ratio transformation. \"alr\": Additive log-ratio transformation. margin integer specifying margin standardization: 1: Rows 2: Columns range_global matrix specifying range standardization (optional, used \"range\" method). logbase base logarithmic transformation (default 2). na.rm Logical. TRUE, missing values (NA) removed calculations. ... Additional arguments passed transformation functions.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Standardize community data matrix — mm_standardize","text":"standardized matrix tibble attributes specifying transformation applied.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Standardize community data matrix — mm_standardize","text":"function provides following standardization methods community data: \"total\": Divides margin total (default margin = 1). \"max\": Divides margin maximum (default margin = 2). \"frequency\": Divides margin total multiplies number non-zero items, ensuring average non-zero entries one (Oksanen 1983; default margin = 2). \"normalize\": Scales data sum squares along specified margin equals one (default margin = 1). \"range\": Standardizes values range [0,1] (default margin = 2). values constant, transformed 0. \"rank\", \"rrank\": \"rank\" replaces abundance values increasing ranks, leaving zeros unchanged. \"rrank\" similar uses relative ranks maximum 1 (default margin = 1). \"standardize\": Scales x zero mean unit variance (default margin = 2). \"pa\": Converts x presence/absence scale (0/1). \"chi.square\": Divides row sums square root column sums, adjusts square root matrix total (Legendre & Gallagher 2001). used Euclidean distance, distances similar Chi-square distances correspondence analysis (default margin = 1). \"hellinger\": Computes square root method = \"total\" (Legendre & Gallagher 2001). \"log\": Logarithmic transformation suggested Anderson et al. (2006): $$\\log_b (x) + 1$$ \\(x > 0\\), \\(b\\) base logarithm. Zeros remain unchanged. Higher bases give less weight quantities presences. \"alr\": Additive log ratio (ALR) transformation (Aitchison 1986). Reduces skewness compositional bias. Requires positive values; pseudocounts can added. transformation defined : $$alr = [\\log(x_1 / x_D), ..., \\log(x_{D-1} / x_D)]$$ denominator sample \\(x_D\\) can chosen arbitrarily. \"clr\": Centered log ratio (CLR) transformation (Aitchison 1986). Common microbial ecology (Gloor et al. 2017). supports positive data; pseudocounts can used handle zeros. transformation defined : $$clr = \\log(x / g(x)) = \\log x - \\log g(x)$$ \\(x\\) single value, \\(g(x)\\) geometric mean \\(x\\). \"rclr\": Robust CLR transformation. Unlike CLR, method allows zeros without requiring pseudocounts. divides values geometric mean observed (non-zero) features, preserving zeros (Martino et al. 2019). transformation defined : $$rclr = \\log(x / g(x > 0))$$ \\(x\\) single value, \\(g(x > 0)\\) geometric mean sample-wide values \\(x\\) positive (\\(x > 0\\)). Standardization, contrasted transformation, means entries transformed relative entries. methods default margin. margin=1 means rows (sites normal data set) margin=2 means columns (species normal data set). Command wisconsin shortcut common Wisconsin double standardization species (margin=2) first standardized maxima (max) sites (margin=1) site totals (tot). standardization methods give nonsense results negative data entries normally occur community data. empty sites species (constant method = \"range\"), many standardization change NaN. Function decobackstand can used transform standardized data back original. possible standardization may implemented cases possible. round-errors back-transformation exact, wise overwrite original data. zap=TRUE original zeros exact.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Standardize community data matrix — mm_standardize","text":"function adapted decostand function vegan R package, modifications improved handling.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Standardize community data matrix — mm_standardize","text":"Aitchison, J. Statistical Analysis Compositional Data (1986). London, UK: Chapman & Hall. Anderson, M.J., Ellingsen, K.E. & McArdle, B.H. (2006) Multivariate dispersion measure beta diversity. Ecology Letters 9, 683–693. Egozcue, J.J., Pawlowsky-Glahn, V., Mateu-Figueras, G., Barcel'o-Vidal, C. (2003) Isometric logratio transformations compositional data analysis. Mathematical Geology 35, 279–300. Gloor, G.B., Macklaim, J.M., Pawlowsky-Glahn, V. & Egozcue, J.J. (2017) Microbiome Datasets Compositional: Optional. Frontiers Microbiology 8, 2224. Legendre, P. & Gallagher, E.D. (2001) Ecologically meaningful transformations ordination species data. Oecologia 129, 271–280. Martino, C., Morton, J.T., Marotz, C.., Thompson, L.R., Tripathi, ., Knight, R. & Zengler, K. (2019) novel sparse compositional technique reveals microbial perturbations. mSystems 4, 1. Oksanen, J. (1983) Ordination boreal heath-like vegetation principal component analysis, correspondence analysis multidimensional scaling. Vegetatio 52, 181–189.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_standardize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Standardize community data matrix — mm_standardize","text":"","code":"# Example usage with sample data cam_data <- read.csv(system.file('penessoulou_season1.csv', package = 'maimer')) cam_data <- cam_data %>% mm_to_community(site_column = camera, species_column = species, size_column = number, values_fill = 0) standardized_data <- mm_standardize(data = cam_data[, 2:11], method = \"total\") standardized_data #> # A tibble: 13 × 10 #> `Syncerus caffer` `Lepus crawshayi` `Erythrocebus patas` #> #> 1 0.981 0 0.0169 #> 2 0 0.375 0.5 #> 3 0.430 0 0.522 #> 4 0.941 0 0 #> 5 0 0 0.0714 #> 6 0.480 0 0.341 #> 7 0 0 1 #> 8 0.247 0 0.306 #> 9 0 0 0 #> 10 0 0 0 #> 11 0 0 0 #> 12 0 0 0 #> 13 0.0240 0 0.974 #> # ℹ 7 more variables: `Tragelaphus scriptus` , #> # `Chlorocebus aethiops` , `Canis adustus` , #> # `Mellivora capensis` , `Sylvicapra grimmia` , #> # `Thryonomys swinderianus` , `Genetta genetta` "},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"function estimates analyzes temporal shift activity species two time periods using kernel density estimation. computes activity distributions determines magnitude direction shift.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"","code":"mm_temporal_shift( first_period, second_period, convert_time = FALSE, xscale = 24, xcenter = c(\"noon\", \"midnight\"), n_grid = 128, kmax = 3, adjust = 1, width_at = 1/2, format = \"%H:%M:%S\", time_zone, plot = TRUE, linestyle_1 = list(), linestyle_2 = list(), posestyle_1 = list(), posestyle_2 = list(), ... )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"first_period numeric vector representing activity times radians first period. second_period numeric vector representing activity times radians second period. convert_time Logical. TRUE, converts times radians analysis. xscale numeric value scale x-axis. Default 24 representing time hours. xcenter string indicating center x-axis. Options \"noon\" (default) \"midnight\". n_grid integer specifying number grid points density estimation. Default 128. kmax integer indicating maximum number modes allowed activity pattern. Default 3. adjust numeric value adjust bandwidth kernel density estimation. Default 1. width_at Numeric. fraction maximum density activity width measured (default 0.5). format Character. Format time input (default \"%H:%M:%S\"). Used convert_time = TRUE. time_zone Character. Time zone time conversion. Required convert_time = TRUE. plot Logical. TRUE, generates plot comparing activity distributions two periods. linestyle_1 List. Line style settings first period's density plot. Includes linetype, linewidth, color. linestyle_2 List. Line style settings second period's density plot. Includes linetype, linewidth, color. posestyle_1 List. Marker style settings first period's density range. Includes shape, size, color, alpha. posestyle_2 List. Marker style settings second period's density range. Includes shape, size, color, alpha. ... Additional arguments (currently unused).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"list containing: tibble : First period range: start end times active periods first dataset. Second period range: start end times active periods second dataset. Shift size (hour): absolute difference activity duration two periods. Move: categorical description shift (\"Forward\", \"Backward\", \"Expanded\", \"Contracted\", etc.). plot (optional): ggplot2 object visualizing density distributions plot = TRUE.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_temporal_shift.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the temporal shift of one species' activity over two periods — mm_temporal_shift","text":"","code":"library(ggplot2) # Using radians as input first_period <- c(1.3, 2.3, 2.5, 5.2, 6.1, 2.3) # Example timestamps for period 1 second_period <- c(1.8, 2.2, 2.5) # Example timestamps for period 2 result <- mm_temporal_shift(first_period, second_period, plot = TRUE, xcenter = \"noon\", linestyle_1 = list(color = \"gray10\", linetype = 1, linewidth = 1), linestyle_2 = list(color = \"#b70000\", linetype = 5, linewidth = .5)) result #> [[1]] #> # A tibble: 1 × 4 #> `First period range` `Second period range` `Shift size (in hour)` Move #> #> 1 06:59:32 - 10:34:58 06:25:31 - 10:12:18 0.19 Backward #> #> $plot #> # customize the graph associated result result$plot+ labs(color = \"Periods\")+ theme(legend.position = \"top\") # Using time strings as input first_period <- c(\"12:03:05\", \"13:10:09\", \"14:08:10\", \"14:18:30\", \"18:22:11\") second_period <- c(\"13:00:20\", \"14:20:10\", \"15:55:20\", \"16:03:01\", \"16:47:00\") result <- mm_temporal_shift(first_period, second_period, convert_time = TRUE, format = \"%H:%M:%S\", time_zone = \"UTC\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Data to a Community Matrix — mm_to_community","title":"Convert Data to a Community Matrix — mm_to_community","text":"function transforms input data community matrix rows represent sites, columns represent species, values indicate count abundance species site.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Data to a Community Matrix — mm_to_community","text":"","code":"mm_to_community( data, site_column, species_column, size_column, values_fill = NULL )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Data to a Community Matrix — mm_to_community","text":"data data frame containing input data. site_column column data frame representing site identifiers. Can specified string unquoted column name. species_column column data frame representing species identifiers. Can specified string unquoted column name. size_column (Optional) column representing size abundance species site. provided, counts species occurrences calculated. values_fill (Optional) value fill missing cells resulting community matrix. Defaults NULL.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Data to a Community Matrix — mm_to_community","text":"tibble rows represent sites, columns represent species, values represent count abundance species.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert Data to a Community Matrix — mm_to_community","text":"function creates site--species matrix suitable ecological analysis. size_column provided, function counts occurrences species per site. size_column provided, values used measure species abundance.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_community.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Data to a Community Matrix — mm_to_community","text":"","code":"# Example data df <- dplyr::tibble( site = c(\"A\", \"A\", \"B\", \"B\", \"C\"), species = c(\"sp1\", \"sp2\", \"sp1\", \"sp3\", \"sp2\"), abundance = c(5, 2, 3, 1, 4) ) # Convert to community matrix with counts mm_to_community(df, site_column = site, species_column = species) #> # A tibble: 3 × 4 #> site sp1 sp2 sp3 #> #> 1 A 1 1 NA #> 2 B 1 NA 1 #> 3 C NA 1 NA # Convert to community matrix with abundance mm_to_community(df, site_column = site, species_column = species, size_column = abundance) #> # A tibble: 3 × 4 #> site sp1 sp2 sp3 #> #> 1 A 5 2 NA #> 2 B 3 NA 1 #> 3 C NA 4 NA # Fill missing cells with 0 mm_to_community(df, site_column = site, species_column = species, values_fill = 0) #> # A tibble: 3 × 4 #> site sp1 sp2 sp3 #> #> 1 A 1 1 0 #> 2 B 1 0 1 #> 3 C 0 1 0"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert camera trap data to occupancy format — mm_to_occupancy","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"function transforms camera trap detection data occupancy format suitable analysis. aggregates detections user-defined time windows optionally converts counts presence-absence (0/1) data.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"","code":"mm_to_occupancy( data, date_column, format = \"%Y-%m-%d\", site_column, species_column, size_column, by_day = 7, presence_absence = TRUE )"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"data data frame containing camera trap detection records. date_column name column containing detection dates. format character string. specified converting character representation, try c(\"%Y-%m-%d\", \"%Y/%m/%d\") one one, give error none works. Otherwise, processing via strptime() whose help page describes available conversion specifications. site_column name column identifying sampling sites. species_column name column containing species names. Can NULL species information needed. size_column name column representing detection counts. by_day integer specifying number days per time window (default: 7). presence_absence Logical. TRUE, converts counts presence-absence data (1 = detected, 0 = detected). Default TRUE.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"wide-format data frame rows represent sites (optionally species), columns represent detection windows. Values indicate either detection counts presence-absence (0/1).","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_occupancy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert camera trap data to occupancy format — mm_to_occupancy","text":"","code":"data <- data.frame( date = c(\"01-01-2023\", \"03-01-2023\", \"10-01-2023\", \"15-01-2023\"), site = c(\"A\", \"A\", \"B\", \"B\"), species = c(\"Tiger\", \"Tiger\", \"Deer\", \"Deer\"), count = c(1, 2, 3, 1) ) occupancy_data <- mm_to_occupancy( data, date_column = date, site_column = site, species_column = species, size_column = count, by_day = 7, presence_absence = TRUE ) occupancy_data #> # A tibble: 4 × 732 #> site species `1-01-20 to 1-01-26` `1-01-27 to 1-02-02` `1-02-03 to 1-02-09` #> #> 1 A Deer 0 0 0 #> 2 A Tiger 0 0 0 #> 3 B Deer 0 0 0 #> 4 B Tiger 0 0 0 #> # ℹ 727 more variables: `1-02-10 to 1-02-16` , `1-02-17 to 1-02-23` , #> # `1-02-24 to 1-03-02` , `1-03-03 to 1-03-09` , #> # `1-03-10 to 1-03-16` , `1-03-17 to 1-03-23` , #> # `1-03-24 to 1-03-30` , `1-03-31 to 1-04-06` , #> # `1-04-07 to 1-04-13` , `1-04-14 to 1-04-20` , #> # `1-04-21 to 1-04-27` , `1-04-28 to 1-05-04` , #> # `1-05-05 to 1-05-11` , `1-05-12 to 1-05-18` , …"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert time to radians — mm_to_radian","title":"Convert time to radians — mm_to_radian","text":"function converts time values radians, often used circular statistics time--day analyses.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert time to radians — mm_to_radian","text":"","code":"mm_to_radian(data, times, format = \"%H:%M:%S\", time_zone = \"UTC\")"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert time to radians — mm_to_radian","text":"data data frame containing column time values. Optional. NULL, times parameter treated standalone vector. times column name data vector time values converted. Time values format recognized .POSIXct(). format string specifying format time values, using standard POSIX formatting syntax. Default \"%H:%M:%S\". time_zone string specifying time zone interpreting time values. Default \"UTC\".","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert time to radians — mm_to_radian","text":"data provided, function returns input data frame additional column named time_radian. data provided, function returns numeric vector time values converted radians.","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert time to radians — mm_to_radian","text":"function converts time values radians based 24-hour clock: full day (24 hours) corresponds \\(2\\pi\\) radians. fractional time day calculated : $$\\text{Fraction day} = \\frac{\\text{hours}}{24} + \\frac{\\text{minutes}}{1440} + \\frac{\\text{seconds}}{86400}$$ example, time 23 hours, 6 minutes, 12 seconds: $$\\text{Fraction day} = \\frac{23}{24} + \\frac{6}{1440} + \\frac{12}{86400}$$ convert fraction radians: $$\\text{Radians} = \\text{Fraction day} \\times 2\\pi$$","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_radian.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert time to radians — mm_to_radian","text":"","code":"if (FALSE) { # \\dontrun{ # Convert a standalone vector of time values times <- c(\"00:00:00\", \"06:00:00\", \"12:00:00\", \"18:00:00\") mm_to_radian(times = times, format = \"%H:%M:%S\") # Convert a column of time values in a data frame data <- data.frame(times = c(\"00:00:00\", \"06:00:00\", \"12:00:00\", \"18:00:00\")) mm_to_radian(data = data, times = times, format = \"%H:%M:%S\") } # }"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Radian to Time — mm_to_time","title":"Convert Radian to Time — mm_to_time","text":"function converts angle radians (representing fraction full circle) time format '%H:%M:%S'. conversion assumes radian value represents fraction 24-hour day (.e., 0 radians midnight \\(2\\pi\\) radians next midnight).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Radian to Time — mm_to_time","text":"","code":"mm_to_time(radian)"},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Radian to Time — mm_to_time","text":"radian numeric value vector representing angle radians. value must lie within range \\([0, 2\\pi]\\), 0 corresponds midnight (00:00:00) \\(2\\pi\\) corresponds next midnight (24:00:00).","code":""},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Radian to Time — mm_to_time","text":"character string representing time format '%H:%M:%S'.","code":""},{"path":[]},{"path":"https://stangandaho.github.io/maimer/reference/mm_to_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Radian to Time — mm_to_time","text":"","code":"# Convert 1.6 radians to time mm_to_time(1.6) #> [1] \"06:06:42\" # Output: \"06:06:42\""},{"path":"https://stangandaho.github.io/maimer/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"Pipe operator Pipe operator","code":""},{"path":"https://stangandaho.github.io/maimer/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs lhs %<>% rhs"},{"path":[]},{"path":"https://stangandaho.github.io/maimer/news/index.html","id":"first-release-highlights-0-2-0","dir":"Changelog","previous_headings":"","what":"First Release Highlights","title":"maimer 0.2.0","text":"Initial release maimer Provides tidyverse-friendly functions data cleaning, transformation, visualization. Includes support alpha & beta diversity, species activity overlap, temporal analysis. Integrates ggplot2 customizable visualizations. Features interactive Shiny app image metadata handling","code":""}]