knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
dacol provides utilities to add or modify columns in dataframe.
The utilities include:
mode
, confident_interval
, ceiling
cosine
, logistic
, zscore
euclidean
, pearson
, cosine
, canberra
trim_outlier
, normalize_ptile
decile_band
, decile_ptile
, dc_rank_ptile
More info: https://ldanai.github.io/dacol/
You can install dacol from github with:
# install.packages("remotes") remotes::install_github("ldanai/dacol")
This shows how to use dacol:
library(dacol) library(dplyr) max = 30 df = tibble(x1 = seq(-1.2*max, 1.2*max, length.out = 200), x2 = seq(0, max, length.out = 200), x3 = sample(200)) df df = df %>% mutate( # Transformation y_cosine = dc_cosine(x1, max), y_logistic = dc_logistic(x2, max), y_zcore = dc_zscore(x2), # Distant between 2 vector columns y_dist_canb = dc_dist_canberra(x2, x3), y_dist_cos = dc_dist_cosine(x2, y_zcore), y_dist_euc = dc_dist_euclidean(x2, y_zcore), y_dist_pear = dc_dist_pearson(x2, y_zcore), # Manage outliers y_trim = dc_trim_outlier(x3, 0.01), y_norm = dc_normalize_ptile(x3, 0.01), # Stats measures y_mode = dc_mode(x3), y_ceil = dc_ceiling(x1, -1), # Band segmentation y_dec_band1 = dc_decile_band(x3), y_dec_band2 = dc_decile_band(x3, c(seq(0, 0.9, 0.1))), y_dec_ptile1 = dc_decile_ptile(x3), y_dec_ptile2 = dc_decile_ptile(x3, c(seq(0, 0.9, 0.1))), # Rank percentile y_ranked1 = dc_rank_ptile(x3), y_ranked2 = dc_rank_ptile(x3, c(seq(1, 100, 1))) ) df
Please note that the 'dacol' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.