MyNixOS website logo
Description

Provides Batch Functions and Visualisation for Basic Statistical Procedures.

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.

rfriend

CRAN Version
License: GPL-3

Overview

rfriend is an R package designed to streamline data analysis and statistical testing by wrapping complex or repetitive code into convenient, user-friendly functions prefixed with f_. Its primary focus is data exploration, statistical tests, and creating publication-ready output in multiple formats including PDF, Microsoft Word, and Excel.

The package helps you write shorter code while producing well-formatted summaries, visualizations, and statistical tests, automatically handling data transformations, assumption checking, and post hoc testing.


Features

  • Summary Tables:f_summary() generates comprehensive summary tables.
  • Data Transformations:
    • f_boxcox() for Box-Cox transformations (wrapping MASS/boxcox and rcompanion)
    • f_bestNormalize() wraps and extends normalization from the bestNormalize package.
  • Visualizations: Easily create:
    • Boxplots (f_boxplot())
    • QQ-plots (f_qqnorm())
    • Histograms (f_hist())
    • Density plots
  • Statistical Tests: Run and visualize tests on multiple variables and predictors, with automatic assumption checking and post hoc analysis:
    • ANOVA: f_aov()
    • Kruskal-Wallis: f_kruskal_test()
    • Generalized Linear Models: f_glm()
    • Chi-square Tests: f_chisq_test()
  • Model Comparison: Compare models easily with f_model_comparison().
  • Utilities:
    • f_clear() clears the workspace and restarts R.
    • f_setwd() sets working directory to the current script’s location.
    • f_theme() switches RStudio themes quickly.
    • f_factors() converts multiple dataframe columns to factors.

Installation

rfriend requires R (>= 4.4.0) and several dependencies (see DESCRIPTION for details). You can install the latest released version from CRAN with:


install.packages("rfriend")

If you want the latest development version (if available on GitHub):



# install.packages("devtools")

devtools::install_github("delde001/rfriend")


Basic Usage


library(rfriend)

# Summary of your dataset
  f_summary(your_dataframe)

# Run ANOVA on multiple response variables
  f_aov(response_var1 +  response_var1 ~ predictor1 * predictor2, data = your_dataframe)

# Create a boxplot of a variable
  data(mtcars)
  f_boxplot(hp + disp ~ gear*cyl,
             data=mtcars,
             boxplot_explanation = FALSE,
             output_type = "word"
             )

# Perform Box-Cox transformation
  transformed <- f_boxcox(your_dataframe$variable)

# Create a boxplot of a variable
  data(mtcars)
  f_boxplot(hp + disp ~ gear*cyl,
             data=mtcars,
             boxplot_explanation = FALSE,
             output_type = "word"
             )

# Perform Box-Cox transformation
transformed <- f_boxcox(your_dataframe$variable)

# Clear workspace and restart R
  f_clear()

For detailed usage and examples, please refer to the package vignettes and help files.


Known Issues

  • When loading rfriend, you may see harmless warnings about S3 method overwrites related to nobs.fitdistr and nobs.multinom due to imported packages (MuMIn, rstatix). These do not affect the functionality.

Contributing

Contributions, bug reports, and feature requests are very welcome! Please open an issue or submit a pull request on GitHub.

Before contributing, please ensure:

  • You have tested your changes locally.
  • Code is properly documented using roxygen2.
  • You follow the existing style and conventions.

License

This package is licensed under GPL-3.


Contact

Author and maintainer: Sander H. van Delden
Email: [email protected]

Feel free to reach out for support, feature requests, or collaborations.


Thank you for using rfriend!

Metadata

Version

2.0.0

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows