bruceR

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

https://github.com/psychbruce/brucer

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.0%) to scientific vocabulary

Keywords

anova cran data-analysis data-science linear-models linear-regression multilevel-models r r-package rstats statistics toolbox
Last synced: 6 months ago · JSON representation

Repository

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

Basic Info
Statistics
  • Stars: 180
  • Watchers: 10
  • Forks: 37
  • Open Issues: 5
  • Releases: 0
Topics
anova cran data-analysis data-science linear-models linear-regression multilevel-models r r-package rstats statistics toolbox
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License

README.md

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 GitHub-Stars

Author

Bruce H. W. S. Bao 包寒吴霜

📬 baohws\@foxmail.com

📋 psychbruce.github.io

Citation

User Guide

NEWS (Changelog)

Chinese Documentation for bruceR: I. Overview

Chinese Documentation for bruceR: II. FAQ

Installation

Please always set dep=TRUE to install ALL package dependencies for FULL features!

``` r

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:

  • Good practices:
    • Restart RStudio before installation.
    • Update R to the latest version (v4.0+).
    • Install Rtools.exe (it is not an R package) on Windows system.
  • If you see "Do you want to restart R prior to install?", choose "Yes" for the first time and then choose "No".
  • 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 with library(bruceR) will also load these R packages for you:

  • [Data]:

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

    • emmeans: Estimates of marginal means and multiple contrasts.
    • lmerTest: Linear mixed effects modeling (multilevel modeling).
    • effectsize: Effect sizes and standardized parameters.
    • performance: Performance of regression models.
    • interactions: Interaction and simple effect analyses.

Main Functions in bruceR

  1. Basic R Programming
-   `cc()` (suggested)
-   `set.wd()` (alias: `set_wd()`) (suggested)
-   `import()`, `export()` (suggested)
-   `pkg_depend()`
-   `formatF()`, `formatN()`
-   `print_table()`
-   `Print()`, `Glue()`, `Run()`
-   `%^%`
-   `%notin%`
-   `%allin%`, `%anyin%`, `%nonein%`, `%partin%`
  1. Multivariate Computation
-   `add()`, `added()` (suggested)
-   `.sum()`, `.mean()` (suggested)
-   `SUM()`, `MEAN()`, `STD()`, `MODE()`, `COUNT()`, `CONSEC()`
-   `RECODE()`, `RESCALE()`
-   `LOOKUP()`
  1. Reliability and Factor Analyses
-   `Alpha()`
-   `EFA()` / `PCA()`
-   `CFA()`
  1. Descriptive Statistics and Correlation Analyses
-   `Describe()`
-   `Freq()`
-   `Corr()`
-   `cor_diff()`
-   `cor_multilevel()`
  1. T-Test, Multi-Factor ANOVA, Simple-Effect Analysis, and Post-Hoc Multiple Comparison
-   `TTEST()`
-   `MANOVA()`
-   `EMMEANS()`
  1. Tidy Report of Regression Models
-   `model_summary()` (suggested)
-   `lavaan_summary()`
-   `GLM_summary()`
-   `HLM_summary()`
-   `HLM_ICC_rWG()`
-   `regress()`
  1. Mediation and Moderation Analyses
-   `PROCESS()` (suggested)
-   `med_summary()`
-   `lavaan_summary()`
  1. 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:

``` r

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) modelsummary(list(lm1, lm2), file="reg.doc") modelsummary(list(lm1, lm2), std=TRUE, file="reg_std.doc") ```

Learn More From Help Pages

``` r 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 ?modelsummary ?lavaansummary ?GLMsummary ?HLMsummary ... ```

Owner

  • Name: Bruce H.-W.-S. Bao
  • Login: psychbruce
  • Kind: user
  • Location: Shanghai, China
  • Company: East China Normal University

🔮 Computational Intelligent Social Psychology | Assistant Professor @ ECNU

GitHub Events

Total
  • Issues event: 6
  • Watch event: 15
  • Issue comment event: 7
  • Push event: 7
  • Fork event: 2
Last Year
  • Issues event: 6
  • Watch event: 15
  • Issue comment event: 7
  • Push event: 7
  • Fork event: 2

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 320
  • Total Committers: 1
  • Avg Commits per committer: 320.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 10
  • Committers: 1
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Bruce p****e@q****m 320
Committer Domains (Top 20 + Academic)
qq.com: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 37
  • Total pull requests: 0
  • Average time to close issues: 21 days
  • Average time to close pull requests: N/A
  • Total issue authors: 30
  • Total pull request authors: 0
  • Average comments per issue: 2.16
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 0
  • Average time to close issues: about 6 hours
  • Average time to close pull requests: N/A
  • Issue authors: 6
  • Pull request authors: 0
  • Average comments per issue: 1.43
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • williamlorder (3)
  • mxjjk (2)
  • XiaoyuZeng (2)
  • chloevoyer (2)
  • waa8128 (2)
  • pomang-211 (2)
  • linzhi0918 (1)
  • chrispan87 (1)
  • BenJCQuah (1)
  • tianranchunzhen (1)
  • linem7 (1)
  • jasonmoy28 (1)
  • professorteschner (1)
  • sangtianc (1)
  • 180312allison (1)
Pull Request Authors
Top Labels
Issue Labels
enhancement (1) documentation (1) good first issue (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 1,970 last-month
  • Total docker downloads: 48
  • Total dependent packages: 4
  • Total dependent repositories: 4
  • Total versions: 20
  • Total maintainers: 1
cran.r-project.org: bruceR

Broadly Useful Convenient and Efficient R Functions

  • Versions: 20
  • Dependent Packages: 4
  • Dependent Repositories: 4
  • Downloads: 1,970 Last month
  • Docker Downloads: 48
Rankings
Forks count: 2.4%
Stargazers count: 3.1%
Average: 7.4%
Downloads: 7.7%
Dependent packages count: 9.3%
Dependent repos count: 14.5%
Maintainers (1)
Last synced: 6 months ago