Learn R Programming

lares

Lean Analytics and Robust Exploration Sidekick


lares is an R package designed to automate, improve, and accelerate everyday analytics and machine learning tasks. It offers a wide variety of functions grouped in families for:

  • Machine Learning: Streamlined model training and evaluation, including friendly AutoML pipelines.
  • Data Cleaning & Processing: Functions to quickly prepare your data for modeling or analyzes.
  • Exploratory Data Analysis (EDA): Instantly visualize and summarize your data.
  • Reporting: Easily generate comprehensive reports to share insights for MMM and ML models.
  • Visualization: Out-of-the-box plotting for classification and regression models, timelines, and more.
  • API Integrations & Scrapers: Simplify data collection from various sources.
  • Time Series & Portfolio Analysis: Specialized utilities for financial and temporal data.
  • Credentials & Secrets Management: Securely handle sensitive information in your analytics pipelines.
  • NLP & Text Analytics: Tools to analyze and process text data.

Tip: See all available functions and documentation here or type ?lares:: in RStudio to explore interactively.


Installation

# CRAN VERSION
install.packages("lares")

# DEV VERSION (latest updates)
# If you don't have remotes installed yet, run: install.packages('remotes')
remotes::install_github("laresbernardo/lares")
# For a full installation with recommended dependencies:
remotes::install_github("laresbernardo/lares", dependencies = TRUE)

Windows users: You may need to install RTools to build the dev version.


Read about lares in action!


Popular Functions

  • h2o_automl(), mplot_full() – Automated machine learning pipeline with optimal model selection and visualizations.
  • freqs(), distr(), corr_var(), corr_cross() – Instantly summarize, visualize, and uncover relationships in your data.
  • ohse() – Efficient and smart one-hot encoding for categorical variables.
  • cache_* – Speed up workflows by caching expensive computations.
  • robyn_* – Additional functions to support Robyn inputs and outputs.
  • fb_* – Interact with Meta's Marketing API
  • gpt_* – Structured prompts builder and interact with OpenAI's API
  • read_encrypted(), write_encrypted() – Interact with encrypted files to keep secrets safe
  • ...and many more!


Getting Started & Help

  • Browse all functions in the online reference.
  • Use ?lares::function_name in RStudio for detailed help on any function.
  • Found a bug or have a feature request? Open an issue.
  • For questions or suggestions, reach out to laresbernardo.

Copy Link

Version

Install

install.packages('lares')

Monthly Downloads

2,485

Version

5.4.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernardo Lares

Last Published

August 28th, 2026

Functions in lares (5.4.1)

cleanText

Clean text strings automatically
ci_lower

Lower/Upper Confidence Intervals
conf_mat

Confussion Matrix
corr_var

Correlation between variable and dataframe
corr_cross

Ranked cross-correlation across all variables
corr

Correlation table
clusterKmeans

Automated K-Means Clustering + PCA/t-SNE
ci_var

Confidence Intervals on Dataframe
clusterOptimalK

Visualize K-Means Clusters for Several K Methods
clusterVisualK

Visualize K-Means Clusters for Several K
date_feats

One Hot Encoding for Date/Time Variables (Dummy Variables)
df_str

Dataset columns and rows structure
crosstab

Weighted Cross Tabulation
dalex_local

DALEX Local
db_upload

Upload Local Files to Dropbox
db_download

Download/Import Dropbox File by File's Name
dalex_residuals

DALEX Residuals
cran_logs

Download and plot daily downloads of CRAN packages
date_cuts

Convert Date into Year + Cut
dalex_variable

DALEX Partial Dependency Plots (PDP)
errors

Calculate Continuous Values Errors
distr

Compare Variables with their Distributions
export_results

Export h2o_automl's Results
dist2d

Distance from specific point to line
etf_sector

ETF's Sectors Breakdown
dfr

Results for AutoML Predictions
export_plot

Export ggplot2, gridExtra, or any plot object into rendered file
dont_sleep

Prevent Computer from Sleeping by Simulating Mouse Activity
dft

Titanic Dataset
encrypt_file

File Encryption and Decryption (AES-256-CBC)
fb_accounts

Facebook Ad Accounts
fb_process

Paginate and Process Facebook's API Results
filesGD

Google Drive Files (API v4)
fb_report_check

Facebook API Report Status Check
fb_rf

Facebook Reach and Frequency API
fb_creatives

Facebook Creatives API
file_name

Extract file raw name and type from file names
fb_insights

Facebook Insights API
fb_token

Facebook's Long-Life User API Token
fb_ads

Facebook Ads API
files_functions

List all functions used in R script files by package
freqs_df

Plot for All Frequencies on Dataframe
freqs

Frequencies Calculations and Plot
freqs_list

Frequencies on Lists and UpSet Plot
forecast_arima

ARIMA Forecast
formatHTML

Format a string text as markdown/HTML
freqs_plot

Combined Frequencies Plot for Categorical Features
font_exists

Check if Font is Installed
removenacols

Remove/Drop Columns in which ALL or SOME values are NAs
formatColoured

Print Coloured Messages
get_credentials

Load Credentials from a YML File
gain_lift

Cumulative Gain, Lift and Response
get_tweets

Get Tweets
readGS

Google Sheets Reading and Writing (API v4)
glued

Interpolate a string [glue wrapper]
gpt_ask

ChatGPT API Interaction with R
gemini_ask

Gemini API Interaction with R
get_currency

Download Historical Currency Exchange Rate
gg_fill_customs

Custom fill, colour and text colours for ggplot2
gtrends_related

Google Trends: Related and Time Plots
grepl_letters

Pattern Matching for Letters considering Blanks
h2o_predict_MOJO

Calculate predictions of h2o Models
h2o_explainer

DALEX Explainer for H2O
h2o_shap

SHAP values for H2O Models
haveInternet

Internet Connection Check
h2o_results

Automated H2O's AutoML Results
h2o_automl

Automated H2O's AutoML
gpt_prompter

Structured Prompt Builder for LLM (ChatGPT)
h2o_selectmodel

Select Model from h2o_automl's Leaderboard
grepm

Pattern Matching for Any or All Multiple Matches
importxlsx

Import Excel File with All Its Tabs
install_recommended

Install/Update Additional Recommended Libraries
holidays

Holidays in your Country
iter_seeds

Iterate Seeds on AutoML
json2vector

Convert Python JSON string to R vector (data.frame with 1 row)
lares

Lean Analytics and Robust Exploration Sidekick
lares-exports

Pipe operator
ip_data

Fetch IP address geolocation data
impute

Impute Missing Values (using MICE)
markdown2df

Convert markdown string tables to data.frame
lasso_vars

Most Relevant Features Using Lasso Regression
image_metadata

Get Meta Data from Image Files
maze_solve

Maze Solver, inspired by Micromouse competitions
lares_logo

Print lares R library Logo
loglossBinary

Logarithmic Loss Function for Binary Models
list_cats

List categorical values for data.frame
lares_pal

Personal Colours Palette
mail_send

Send Emails with Attachments (POST)
listfiles

List files in a directory
left

Left or Right N characters of a string
model_preprocess

Automate Data Preprocess for Modeling
mp3_get

Download MP3 from URL
model_metrics

Model Metrics and Performance
missingness

Calculate and Visualize Missingness
mp3_update_tags

Update MP3 Metadata Tags
mplot_cuts

Cuts by quantiles for score plot
mplot_conf

Confussion Matrix Plot
mplot_cuts_error

Cuts by quantiles on absolute and percentual errors plot
mp3_trim

Trim MP3 Audio File
move_files

Move files from A to B
mplot_response

Cumulative Response Plot
mplot_metrics

Model Metrics and Performance Plots
mplot_lineal

Linear Regression Results Plot
mplot_gain

Cumulative Gain Plot
mplot_splits

Split and compare quantiles plot
mplot_importance

Variables Importances Plot
mplot_roc

ROC Curve Plot
mplot_density

Density plot for discrete and continuous values
mplot_full

MPLOTS Score Full Report Plots
mplot_topcats

Top Hit Ratios for Multi-Classification Models
normalize

Normalize Vector
myip

What's my IP?
outlier_tukey

Outliers: Tukey’s fences
ohse

One Hot Smart Encoding (Dummy Variables)
msplit

Split a dataframe for training and testing sets
num_abbr

Abbreviate or dis-abbreviate numerical values
noPlot

Plot Result with Nothing to Plot
ngrams

Build N-grams and keep most frequent
outlier_zscore

Outliers: Z-score method
ohe_commas

One Hot Encoding for a Vector with Comma Separated Values
plot_df

Plot Summary of Numerical and Categorical Features
quants

Calculate cuts by quantiles
plot_palette

Plot Palette Colours
plot_timeline

Plot timeline as Gantt Plot
outlier_zscore_plot

Outliers: Z-score method plot
plot_chord

Chords Plot
plot_survey

Visualize Survey Results
plot_nums

Plot All Numerical Features (Boxplots)
prophesize

Facebook's Prophet Forecast
plot_cats

Plot All Categorical Features (Frequencies)
reduce_pca

Reduce Dimensionality with PCA
read.file

Read Files Quickly (Auto-detected)
queryDB

PostgreSQL Queries on Database (Read)
reduce_tsne

Reduce Dimensionality with t-SNE
robyn_xmodels

Cross-MMM Budget Optimization across Models
remove_stopwords

Remove stop-words and patterns from character vector
replacefactor

Replace Factor Values
queryGA

Queries on Google Analytics
quiet

Quiet prints and verbose noise
replaceall

Replace Values With
rtistry_sphere

Generative Art: Sphere XmodY
sentimentBreakdown

Sentiment Breakdown on Text
robyn_marginal

Robyn: Marginal Performance (mROAS & mCPA) [Experimental]
robyn_performance

Robyn: Dynamic Performance and Contribution Report
scrabble_dictionary

Scrabble: Dictionaries
shap_var

SHAP-based dependence plots for categorical/numerical features (PDP)
robyn_modelselector

Robyn: Model Selection by Weighted Criteria Scores
robyn_hypsbuilder

Robyn: Generate default hyperparameters
scale_x_comma

Axis scales format
seq_surnames

Surnames Order Sequence
textFeats

Create features out of text
slackSend

Send Slack Message (Webhook)
stocks_quote

Download Stocks Historical and Current Values
statusbar

Progressive Status Bar (Loading)
splot_summary

Investing Portfolio Reporting Plots
textCloud

Wordcloud Plot
spread_list

Spread list column into new columns
stocks_file

Build a Personal Investing Portfolio Report
sudoku_solver

Solve Sudoku Puzzles
target_set

Set Target Value in Target Variable
tree_var

Recursive Partitioning and Regression Trees
updateLares

Update the library (dev or CRAN version)
try_require

Check if Specific Package is Installed
tic

Stopwatch to measure timings in R
theme_lares

Theme for ggplot2 (lares)
textTokenizer

Tokenize Vectors into Words
topics_rake

Keyword/Topic identification using RAKE
vector2text

Convert a vector into a comma separated text
warnifnot

Test the Truth of R Expressions and Warn
toon_reduction

Calculate Character Reduction from R Object to TOON Format
winsorize

Outliers: Winsorize
wordle_check

Wordle Game Validation
what_size

Calculate the size of any R object or directory
x2y

Ranked Predictive Power of Cross-Features (x2y)
year_month

Convert Date into Year-Month, Year-Quarter or Year-Week Format
weighted_value

Calculate weighted stock values using FIFO/LIFO
zerovar

Zero Variance Columns
chr2num

Check character values for date/numeric/logical and change datatype
cache_write

Cache Save and Load (Write and Read)
ROC

AUC and ROC Curves Data
bind_files

Bind Files into Dataframe
cal_split

Split ICS File
bring_api

Get API (JSON) and Transform into data.frame
balance_data

Balance Binary Data by Resampling: Under-Over Sampling
autoline

New Line Feed for Long Strings (Wrapper)
categ_reducer

Reduce categorical values
check_opts

Validate inputs (attributions, options, ...)