Learn R Programming

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

lares

R Package for Analytics and Machine Learning

lares is a library used to automate, improve, and speed everyday Analysis and Machine Learning tasks. It also simplifies the installation process of libraries, distribution, and reproducible research. 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! Do let me know where did you got my contact from ;)

Install the package

devtools::install_github("laresbernardo/lares")

I currently don't have planned to post lares library to CRAN yet, but who knows what might happen!

Update the package

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

See the library in action!

What else is there?

You can type lares:: in RStudio and you will see a pop-up with all the functions that are currently available within the package. If in doubt, you can use the ? function (i.e. ?lares::function) and the Help tab will display a short explanation on each function and its parameters. If you want to check all the documentation, simply run help(package = lares).

Getting further help

If you encounter a clear bug, please share with us a reproducible example on Github and I'll take care of it. For inquiries, and other matters, you can email me directly.

Copy Link

Version

Install

install.packages('lares')

Monthly Downloads

3,942

Version

4.4

License

AGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Bernardo Lares

Last Published

February 19th, 2025

Functions in lares (4.4)

corr_plot

Correlation plot
corr_var

Correlation between variable and dataframe
cleanText

Clean text
corr

Correlation table
distr

Compare Variables with their Distributions
df_str

Dataset columns and rows structure
dist2d

Distance from specific point to line
errors

Calculate Errors
export_plot

Install latest version of H2O
f1_contacts

Hubspot contacts (Somos F1)
forecast_arima

ARIMA Forecast
fr_plotface

Facial Recognition: Plot Face
fr_sendimage

Facial Recognition: Send Image
export_results

Export h2o_automl's Results
get_credentials

Load personal parameters and credentials
get_currency

Download Historical Currency Exchange Rate
categ_reducer

Reduce categorical values
h2o_automl

Automated H2O's AutoML
h2o_predict_model

H2O Predict using H2O Model Object
date_feats

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

Transform any date input into Date
balance_data

Balance Binary Data by Resampling: Under-Over Sampling
fr_getresult

Facial Recognition: Get REsults
fr_live

Facial Recognition: Live Cam
h2o_predict_API

H2O Predict using API Service
importxlsx

Import Excel File with All Its Tabs
ip_country

Find country from a given IP
h2o_selectmodel

Select Model from h2o_automl's Leaderboard
h2o_update

Install latest version of H2O
holidays

Holidays in your Country
bring_api

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

MPLOTS Score Full Report Plots
categoryCounter

Count Categories on a Dataframe
mae

Mean Absolute Error (MAE)
db_download

Download Dropbox File by File's Name
li_auth

OAuth Linkedin
db_upload

Upload Dropbox File
dalex_residuals

DALEX Residuals
dalex_variable

DALEX Partial Dependency Plots (PDP)
mplot_importance

Variables Importances Plot
mailSend

Send Emails with Attachments (Sendgrid)
fr_takeselfie

Facial Recognition: Take a Selfie
li_profile

Get My Personal LinkedIn Data
pass

Pass Through a dplyr's Pipeline
plot_survey

Send Emails with Attachments (Sendgrid)
mplot_cuts_error

Cuts by quantiles on absolut and percentual errors plot
mplot_lineal

Linear Regression Results Plot
mplot_metrics

AUC and LogLoss Plots
myip

What's my IP
mplot_density

Density plot for discrete and continuous values
quants

Calculate cuts by quantiles
nas

Full NAs Analysis on a data.frame
queryDummy

PostgreSQL Queries on Dummy Database (read only)
queryGA

Queries on Google Analytics
forecast_ml

Machine Learning Forecast
freqs

Frequencies Calculations and Plot
formatNum

Nicely Format Numerical Values
noPlot

Plot Result with Nothing to Plot
normalize

Normalize values
replaceall

Replace Values With
stocks_html

Portfolio's Full Report in HTML
stocks_objects

Portfolio's Calculations and Plots
stocks_performance

Stocks Overall Performance
stocks_report

Portfolio's Full Report and Email
removenarows

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

PostgreSQL Queries on Redshift Database (read-write)
removenacols

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

Google Sheets Writing
right

Right: Last n characters
gg_pie

Density plot for discrete and continuous values
geoStratum

Get Colombia's Stratum given the Coordinates
year_month

Convert year month format YYYY-MM
gg_text_customs

Custom colours to use in ggplot as scale_color_manual on texts
missingness

Calculate missingness percentage on a data.frame
mape

Mean Absolute Percentage Error (MAPE)
hs_contacts

Hubspot Contacts
hs_deals

Hubspot Deals
geodataAddress

Get Google's Geodata given the Addresses
stocks_total_plot

Stocks Total Performance Plot
mplot_roc

ROC Curve Plot
dalex_explainer

DALEX Explainer
iter_seeds

Iterate and Search for Best Seed
h2o_predict_binary

H2O Predict using Binary file
h2o_predict_MOJO

H2O Predict using MOJO file
dalex_local

DALEX Local
fr_compare

Facial Recognition: Compare faces
mplot_splits

Split and compare quantiles plot
fr_facecounter

Facial Recognition: Face Counter
get_stocks

Get Personal Portfolio's Data
get_stocks_hist

Download Stocks Historical Data
textCloud

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

Custom colours to use in ggplot as scale_color_manual
left

Left: First n characters
lares-package

lares: R library for Analytics, Visualization & Machine Learning Tasks
gg_fill_customs

Custom colours to use in ggplot as scale_fill_manual
json2vector

Convert JSON string to vector (data.frame with 1 row)
mmetrics

Classification Model Metrics
numericalonly

Filter only Numerical Values and
listfiles

List files in a directory
loglossBinary

Loggarithmic Loss Function for Binary Models
portfolio_distr_plot

Portfolio's Distribution
object_detection

Image's Objects Detection using YOLO
stocks_daily_plot

Stocks Daily Plot
portfolio_performance

Portfolio Overall Performance
stocks_hist_fix

Fix Historical Data on Stocks
mplot_cuts

Cuts by quantiles for score plot
queryProduc

PostgreSQL Queries on Production Database (read-write)
mse

Mean Squared Error (MSE)
msplit

Split a dataframe for training and testing sets
ohse

One Hot Smart Encoding (Dummy Variables)
portfolio_daily_plot

Portfolio Daily Plot
updateLares

Update the library
one_hot_encoding_commas

One Hot Encoding for a Vector with Comma Separated Values
plot_timeline

Density plot for discrete and continuous values
readGS

Google Sheets Reading
vector2text

Convert a vector into a comma separated text
rmse

Root Mean Squared Error (RMSE)
statusbar

Progressbar for for loops
theme_lares

lares Theme for ggplot2
typeform_download

Download typeform data
year_week

Convert year week format YYYY-WW