`supportR`

- Support Functions for Wrangling and Visualization`supportR`

is an R package where the only unifying theme
of the functions is honestly just that I wrote them. That said, there
are some useful functions for **data wrangling** and
**plotting** in particular, though functions for *other
purposes* are also included. I’ll add functions to this package as I
write more orphan scripts that I hope others might find useful so stay
tuned!

You can install the development version from GitHub with:

```
# install.packages("devtools")
::install_github("njlyon0/supportR") devtools
```

: Calculates summary values (mean, standard deviation, sample size, and standard error) of a given response variable within supplied groups`summary_table`

: Checks a column that`num_check`

*should*contain only**numeric**values for any entries that would be coerced to NA if`as.numeric`

is run- An extension of this function is
that accepts a vector of columns to check at the same time`multi_num_check`

- An extension of this function is
: Checks a column that`date_check`

*should*contain only**date**values for any entries that would be coerced to NA if`as.Date`

is run- An extension of this function is
that accepts a vector of columns to check at the same time`multi_date_check`

- An extension of this function is
: Checks a column containing multiple ambiguous date formats and identifies its best guess for the format each date is in (e.g., ‘dd/mm/yyyy’ versus ‘yyyy/dd/mm’, etc.)`date_format_guess`

: Compares two vectors and identifies what elements are found in the first but not the second (i.e.,`diff_check`

*lost*components) and what elements are found in the second but not the first (i.e.,*gained*components)- This use-case is more oblique but I find it useful when I’m checking which columns are in the data before versus after a significant wrangling step to make sure no columns are lost/gained unexpectedly

: Applies a set of modifications to the non-data aspects of a`theme_lyon`

`ggplot2`

plot to ensure a consistent “feel” of a set of plots: Creates a Non-Metric Multi-Dimensional Scaling (NMS) ordination with base R. Requires the dissimilarity matrix returned by`nms_ord`

`vegan::metaMDS`

: Creates a Principal Coordinates Analysis (PCoA) ordination with base R. Requires the distance matrix returned by`pcoa_ord`

`ape::pcoa`

: Removes the specified “triangle” (either upper or lower) of a symmetric data object by replacing with NAs. Also allows user to specify whether to keep or also drop the diagonal`crop_tri`

: “Flattens” an array of dimensions X, Y, and Z into a dataframe containing columns`array_melt`

`x`

,`y`

,`z`

, and`value`

where`value`

is whatever was stored in the array at those coordinates

: Allows knitting of a specified R Markdown file locally and simultaneously to a specified Google Drive folder.`rmd_export`

*NOTE:*you must authorize R to work with Google Drive by using`googldrive::drive_auth`

for this function to work

More functions are likely to be developed and housed within this package so stay tuned! Feel free to post ideas for new functions as an issue on this repository and I’ll do my best to build them!