Learn R Programming

rfriend (version 1.0.0)

Provides Batch Functions and Visualisation for Basic Statistical Procedures

Description

Designed to streamline data analysis and statistical testing, reducing the length of R scripts while generating well-formatted outputs in 'pdf', 'Microsoft Word', and 'Microsoft Excel' formats. In essence, the package contains functions which are sophisticated wrappers around existing R functions that are called by using 'f_' (user f_riendly) prefix followed by the normal function name. This first version of the 'rfriend' package focuses primarily on data exploration, including tools for creating summary tables, f_summary(), performing data transformations, f_boxcox() in part based on 'MASS/boxcox' and 'rcompanion', and f_bestNormalize() which wraps and extends functionality from the 'bestNormalize' package. Furthermore, 'rfriend' can automatically (or on request) generate visualizations such as boxplots, f_boxplot(), QQ-plots, f_qqnorm(), histograms f_hist(), and density plots. Additionally, the package includes four statistical test functions: f_aov(), f_kruskal_test(), f_glm(), f_chisq_test for sequential testing and visualisation of the 'stats' functions: aov(), kruskal.test(), glm() and chisq.test. These functions support testing multiple response variables and predictors, while also handling assumption checks, data transformations, and post hoc tests. Post hoc results are automatically summarized in a table using the compact letter display (cld) format for easy interpretation. The package also provides a function to do model comparison, f_model_comparison(), and several utility functions to simplify common R tasks. For example, f_clear() clears the workspace and restarts R with a single command; f_setwd() sets the working directory to match the directory of the current script; f_theme() quickly changes 'RStudio' themes; and f_factors() converts multiple columns of a data frame to factors, and much more. If you encounter any issues or have feature requests, please feel free to contact me via email.

Copy Link

Version

Install

install.packages('rfriend')

Version

1.0.0

License

GPL-3

Maintainer

Sander H. van Delden

Last Published

July 16th, 2025

Functions in rfriend (1.0.0)

f_glm

Perform multiple glm() functions with diagnostics, assumption checking, and post-hoc analysis
f_load_packages

Install and Load Multiple R Packages
f_kruskal_test

Perform multiple Kruskal-Wallis tests with a user-friendly output file, do data inspection and Dunn's test (of 'rstatix') as post hoc.
f_rename_vector

Rename Elements of a Vector Based on a Mapping
f_qqnorm

Normal Q-Q Plot with Confidence Bands
f_hist

Plot a Histogram with an Overlaid Normal Curve
f_model_comparison

Compare Two Statistical Models
f_setwd

Set Working Directory Based on Current File or Specified Path
f_pander

Fancy Pander Table Output
f_open_file

Open a File with the Default Application
f_summary

Summarize a Data Frame with Grouping Variables
print.f_summary

Print method for f_summary objects
f_rename_columns

Rename Specific Columns in a Data Frame
f_theme

Apply a black or white 'RStudio' Theme and Zoom Level
plot.f_boxcox

Plot an f_boxcox object
plot.f_bestNormalize

Plot an f_bestNormalize object
f_boxplot

Generate a Boxplot Report of a data.frame
f_factors

Convert multiple columns to Factors in a data frame
f_corplot

Correlation Plots with Factor Detection and Customization
f_aov

Perform multiple aov() functions with optional data transformation, inspection and Post Hoc test.
f_conditional_round

Conditional Rounding for Numeric Values
f_chisq_test

Chi-squared Test with Post-hoc Analysis
f_clear

f_clear: Clear Various Aspects of the R Environment
f_boxcox

f_boxcox: A User-Friendly Box-Cox Transformation
f_bestNormalize

f_bestNormalize: Automated Data Normalization with bestNormalize