All Projects → psychbruce → bruceR

psychbruce / bruceR

Licence: GPL-3.0 license
📦 BRoadly Useful Convenient and Efficient R functions that BRing Users Concise and Elegant R data analyses.

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to bruceR

apsimx
R package for APSIM-X
Stars: ✭ 30 (-72.73%)
Mutual labels:  cran, r-package
ctrdata
Aggregate and analyse information on clinical trials from public registers
Stars: ✭ 26 (-76.36%)
Mutual labels:  cran, r-package
oem
Penalized least squares estimation using the Orthogonalizing EM (OEM) algorithm
Stars: ✭ 22 (-80%)
Mutual labels:  cran, r-package
rcppfastfloat
Rcpp Bindings for the 'fastfloat' Header-Only Library
Stars: ✭ 18 (-83.64%)
Mutual labels:  cran, r-package
vosonSML
R package for collecting social media data and creating networks for analysis.
Stars: ✭ 65 (-40.91%)
Mutual labels:  cran, r-package
rcppsimdjson
Rcpp Bindings for the 'simdjson' Header Library
Stars: ✭ 103 (-6.36%)
Mutual labels:  cran, r-package
RcppEigen
Rcpp integration for the Eigen templated linear algebra library
Stars: ✭ 89 (-19.09%)
Mutual labels:  cran, r-package
Pacman
A package management tools for R
Stars: ✭ 220 (+100%)
Mutual labels:  cran, r-package
eia
An R package wrapping the US Energy Information Administration open data API.
Stars: ✭ 38 (-65.45%)
Mutual labels:  cran, r-package
rcppcnpy
Rcpp bindings for NumPy files
Stars: ✭ 24 (-78.18%)
Mutual labels:  cran, r-package
rdomains
Classifying the content of domains
Stars: ✭ 47 (-57.27%)
Mutual labels:  cran, r-package
thinkr
Some tools for cleaning up messy 'Excel' files to be suitable for R
Stars: ✭ 21 (-80.91%)
Mutual labels:  cran, r-package
Littler
A scripting and command-line front-end for GNU R
Stars: ✭ 238 (+116.36%)
Mutual labels:  cran, r-package
packagefinder
Comfortable search for R packages on CRAN, either directly from the R console or with an R Studio add-in
Stars: ✭ 43 (-60.91%)
Mutual labels:  cran, r-package
Tint
Tint is not Tufte
Stars: ✭ 226 (+105.45%)
Mutual labels:  cran, r-package
metafor
A meta-analysis package for R
Stars: ✭ 174 (+58.18%)
Mutual labels:  multilevel-models, r-package
Simmer
Discrete-Event Simulation for R
Stars: ✭ 170 (+54.55%)
Mutual labels:  cran, r-package
Arsenal
An Arsenal of 'R' Functions for Large-Scale Statistical Summaries
Stars: ✭ 171 (+55.45%)
Mutual labels:  cran, r-package
healthyR
Hospital Data Analysis Workflow Tools
Stars: ✭ 21 (-80.91%)
Mutual labels:  cran, r-package
rcpptoml
Rcpp Bindings to C++ parser for TOML files
Stars: ✭ 26 (-76.36%)
Mutual labels:  cran, r-package

bruceR

BRoadly Useful Convenient and Efficient R functions that BRing Users Concise and Elegant R data analyses.

This package includes easy-to-use functions for:

  1. Basic R programming (e.g., set working directory to the path of currently opened file; import/export data from/to files in any format; print tables to Microsoft Word);
  2. Multivariate computation (e.g., compute scale sums/means/... with reverse scoring);
  3. Reliability analyses and factor analyses (PCA, EFA, CFA);
  4. Descriptive statistics and correlation analyses;
  5. t-test, multi-factor analysis of variance (ANOVA), simple-effect analysis, and post-hoc multiple comparison;
  6. Tidy report of statistical models (to R Console and Microsoft Word);
  7. Mediation and moderation analyses (PROCESS);
  8. Additional toolbox for statistics and graphics.

CRAN-Version GitHub-Version R-CMD-check CRAN-Downloads Logo-Designer GitHub-Stars

Author

Han-Wu-Shuang (Bruce) Bao 包寒吴霜

Email: [email protected]

Homepage: psychbruce.github.io

Citation

User Guide

NEWS (Changelog)

Chinese Documentation for bruceR: I. Overview

Chinese Documentation for bruceR: II. FAQ

Installation

## Method 1: Install from CRAN
install.packages("bruceR", dep=TRUE)  # dependencies=TRUE

## Method 2: Install from GitHub
install.packages("devtools")
devtools::install_github("psychbruce/bruceR", dep=TRUE, force=TRUE)

Tips:

  1. Good practice: restart RStudio before installation.
  2. Good practice: update R to the latest version (v4.0+).
  3. Good practice: install Rtools.exe (it is not an R package) on Windows system.
  4. If you see "Do you want to restart R prior to install?", choose "Yes" at the first time and then choose "No".
  5. If you see "Do you want to install from sources the package which needs compilation?", just choose "No".
  6. If you fail to install, please carefully read the warning messages and find out the R package(s) causing the failure, manually uninstall and reinstall these R package(s), and then retry the main installation.

Package Dependency

bruceR depends on many important R packages.

Loading bruceR by library(bruceR) will also load these R packages for you:

  • [Data]:

    • dplyr: Data manipulation and processing.
    • tidyr: Data cleaning and reshaping.
    • stringr: Toolbox for string operation (with regular expressions).
    • forcats: Toolbox for factor manipulation (for categorical variables).
    • data.table: Advanced data.frame with higher efficiency.
  • [Stat]:

    • emmeans: Estimates of marginal means and multiple contrasts.
    • effectsize: Estimates of effect sizes and standardized parameters.
    • performance: Estimates of regression models performance.
    • lmerTest: Tests of linear mixed effects models (LMM, also known as HLM and multilevel models).
  • [Plot]:

    • ggplot2: Data visualization.
    • ggtext: Markdown/HTML rich text format for ggplot2 (geoms and themes).
    • cowplot: Advanced toolbox for ggplot2 (arrange multiple plots and add labels).
    • see: Advanced toolbox for ggplot2 (geoms, scales, themes, and color palettes).

Main Functions in bruceR

  1. Basic R Programming

    • cc() (suggested)
    • set.wd() (alias: set_wd()) (suggested)
    • import(), export() (suggested)
    • pkg_depend(), pkg_install_suggested()
    • formatF(), formatN()
    • print_table()
    • Print(), Glue(), Run()
    • %^%
    • %notin%
    • %allin%, %anyin%, %nonein%, %partin%
  2. Multivariate Computation

    • add(), added() (suggested)
    • .sum(), .mean() (suggested)
    • SUM(), MEAN(), STD(), MODE(), COUNT(), CONSEC()
    • RECODE(), RESCALE()
    • LOOKUP()
  3. Reliability and Factor Analyses

    • Alpha()
    • EFA() / PCA()
    • CFA()
  4. Descriptive Statistics and Correlation Analyses

    • Describe()
    • Freq()
    • Corr()
    • cor_diff()
  5. T-Test, Multi-Factor ANOVA, Simple-Effect Analysis, and Post-Hoc Multiple Comparison

    • TTEST()
    • MANOVA()
    • EMMEANS()
  6. Tidy Report of Regression Models

    • model_summary() (suggested)
    • lavaan_summary()
    • GLM_summary()
    • HLM_summary()
    • HLM_ICC_rWG()
    • regress()
  7. Mediation and Moderation Analyses

    • PROCESS() (suggested)
    • med_summary()
  8. Additional Toolbox for Statistics and Graphics

    • grand_mean_center()
    • group_mean_center()
    • ccf_plot()
    • granger_test()
    • granger_causality()
    • theme_bruce()
    • show_colors()

Function Output

For some functions, the results can be saved to Microsoft Word using the file argument.

bruceR Function Output: R Console Output: MS Word
print_table() √ (basic usage)
Describe()
Freq()
Corr() √ (suggested)
Alpha() (unnecessary)
EFA() / PCA()
CFA()
TTEST()
MANOVA()
EMMEANS()
PROCESS() √ (partial)
model_summary() √ (suggested)
med_summary()
lavaan_summary()
GLM_summary()
HLM_summary()
HLM_ICC_rWG() (unnecessary)
granger_test()
granger_causality()

Examples:

## Correlation analysis (and descriptive statistics)
Corr(airquality, file="cor.doc")

## Regression analysis
lm1 = lm(Temp ~ Month + Day, data=airquality)
lm2 = lm(Temp ~ Month + Day + Wind + Solar.R, data=airquality)
model_summary(list(lm1, lm2), file="reg.doc")
model_summary(list(lm1, lm2), std=TRUE, file="reg_std.doc")

Learn More From Help Pages

library(bruceR)

## Overview
help("bruceR")
help(bruceR)
?bruceR

## See help pages of functions
## (use `?function` or `help(function)`)
?cc
?add
?.mean
?set.wd
?import
?export
?Describe
?Freq
?Corr
?Alpha
?MEAN
?RECODE
?TTEST
?MANOVA
?EMMEANS
?PROCESS
?model_summary
?lavaan_summary
?GLM_summary
?HLM_summary
...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].