knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(magrittr)
envFunc
: an R package of tools to help with other env
PackagesThe goal of envFunc
is to store functions that help across the other env
Packages.
envFunc
is not on CRAN.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("Acanthiza/envFunc")
Load envFunc
library("envFunc")
add_time_stamp
adds the creation time of an object as an attribute.
temp <- cars %>% envFunc::add_time_stamp() attr(temp, "ctime")
x <- tibble::tibble(x = rbeta(10, 1, 1)) %>% add_likelihood(x) x
envFunc
The following functions and data sets are provided in envFunc
. See https://acanthiza.github.io/envFunc/ for more examples.
get_name_title <- function(text) { tibble::enframe(text , name = NULL , value = "description" ) %>% dplyr::filter(grepl("title", description)) %>% dplyr::mutate(description = gsub("\\\\|title", "", description) , description = gsub("^\\{|\\}$", "", description) ) } manuals <- fs::dir_info("man") %>% dplyr::select(path) %>% dplyr::filter(grepl("Rd$", path) , !grepl("pipe", path) ) %>% dplyr::mutate(object = gsub("man\\/|\\.Rd","",path) , class = purrr::map_chr(object, ~envFunc::vec_to_sentence(class(get(.)))) , text = purrr::map(path, readLines) , text = purrr::map(text, get_name_title) , object = paste0("`envFunc::" , object , "`" ) ) %>% tidyr::unnest(cols = c(text)) knitr::kable(manuals[,2:4])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.