Learn R Programming

⚠️There's a newer version (5.3.1) of this package.Take me there.

library(lares)

This is my personal library used to automate and speed my everyday work on Analysis and Machine Learning tasks. You are most welcome to install, use, and comment on any of its code and functionalities. Feel free to contact me and/or add me on Linkedin!

Getting Started

Fresh library install

devtools::install_github("laresbernardo/lares")

Update library

lares::updateLares() # From Github repository (Bitbucket discontinued)
lares::updateLares(local=T) # Personal and local files, not necessarily deployed

Everytime you update the library, I recommend restarting your session: close RStudio and reopen it. You can also set the restart = TRUE parameter on the updateLares() function.

Some posts published using the library

Copy Link

Version

Install

install.packages('lares')

Monthly Downloads

5,440

Version

4.1

License

Private

Issues

Pull Requests

Stars

Forks

Maintainer

Bernardo Lares

Last Published

July 4th, 2025

Functions in lares (4.1)

auto_preprocess

Auto-Preprocessing data for a Machine Learning Model
forecast_arima

ARIMA Forecast
forecast_ml

Machine Learning Forecast
fr_facecounter

Facial Recognition: Face Counter
fr_getresult

Facial Recognition: Get REsults
gg_text_customs

Custom colours to use in ggplot as scale_color_manual on texts
dalex_local

DALEX Local
h2o_automl

Automated H2O's AutoML
dalex_residuals

DALEX Residuals
hs_deals

Hubspot Deals
ip_country

Find country from a given IP
mplot_full

MPLOTS Score Full Report Plots
mplot_importance

Variables Importances Plot
freqs

Frequencies Calculations and Plot
one_hot_encoding_commas

One Hot Encoding for a Vector with Comma Separated Values
geoStratum

Get Colombia's Stratum given the Coordinates
get_stocks

Get Personal Portfolio's Data
get_stocks_hist

Download Stocks Historical Data
loglossBinary

Loggarithmic Loss Function for Binary Models
corr_var

Correlation between variable and dataframe
dalex_explainer

DALEX Explainer
dalex_variable

DALEX Partial Dependency Plots (PDP)
mae

Mean Absolute Error (MAE)
mplot_lineal

Linear Regression Results Plot
plot_distr

Plot Target's Distribution vs Another Variable
mplot_metrics

AUC and LogLoss Plots
portfolio_performance

Portfolio Overall Performance
dateformat

Transform any date input into Date
queryDW

PostgreSQL Queries on Redshift Database (read-write)
stocks_daily_plot

Stocks Daily Plot
fr_live

Facial Recognition: Live Cam
fr_plotface

Facial Recognition: Plot Face
replaceall

Replace Values With
gg_colour_customs

Custom colours to use in ggplot as scale_color_manual
gg_fill_customs

Custom colours to use in ggplot as scale_fill_manual
stocks_hist_fix

Fix Historical Data on Stocks
typeform_download

Download typeform data
rmse

Root Mean Squared Error (RMSE)
queryProduc

PostgreSQL Queries on Production Database (read-write)
readGS

Google Sheets Reading
updateLares

Update the library
stocks_total_plot

Stocks Total Performance Plot
textCloud

Study the distribution of a target variable vs another variable. This function is quite similar to the funModeling's corrplot function.
bring_api

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

Reduce categorical values
fr_sendimage

Facial Recognition: Send Image
fr_takeselfie

Facial Recognition: Take a Selfie
categoryCounter

Count Categories on a Dataframe
geodataAddress

Get Google's Geodata given the Addresses
cleanText

Clean text
export_results

Export h2o_automl's Results
get_credentials

Load personal parameters and credentials
missingness

Calculate missingness percentage on a data.frame
mplot_cuts

Cuts by quantiles for score plot
f1_contacts

Hubspot contacts (Somos F1)
h2o_selectmodel

Select Model from h2o_automl's Leaderboard
hs_contacts

Hubspot Contacts
mplot_roc

ROC Curve Plot
mailSend

Send Emails with Attachments (Sendgrid)
mape

Mean Absolute Percentage Error (MAPE)
mplot_splits

Split and compare quantiles plot
nas

Full NAs Analysis on a data.frame
normalize

Normalize values
mplot_cuts_error

Cuts by quantiles on absolut and percentual errors plot
mplot_density

Density plot for discrete and continuous values
numericalonly

Filter only Numerical Values and
object_detection

Image's Objects Detection using YOLO
queryDummy

PostgreSQL Queries on Dummy Database (read only)
stocks_html

Portfolio's Full Report in HTML
queryGA

Queries on Google Analytics
stocks_objects

Portfolio's Calculations and Plots
corr

Correlation table
removenacols

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

Correlation plot
dist2d

Distance from specific point to line
removenarows

Remove/Drop Rows in which ALL or SOME values are NAs
vector2text

Convert a vector into a comma separated text
errors

Calculate Errors
formatNum

Nicely Format Numerical Values
fr_compare

Facial Recognition: Compare faces
writeGS

Google Sheets Writing
iter_seeds

Iterate and Search for Best Seed
listfiles

List files in a directory
mse

Mean Squared Error (MSE)
msplit

Split a dataframe for training and testing sets
portfolio_daily_plot

Portfolio Daily Plot
portfolio_distr_plot

Portfolio's Distribution
stocks_performance

Stocks Overall Performance
stocks_report

Portfolio's Full Report and Email
year_month

Convert year month format YYYY-MM
year_week

Convert year week format YYYY-WW
balance_data

Balance Binary Data by Resampling: Under-Over Sampling