knitr::opts_chunk$set( collapse = FALSE, fig.height = 4, fig.width = 6, comment = "#>", fig.path = "README-" )
fig_dir <- "https://raw.githubusercontent.com/GegznaV/RcmdrPlugin.biostat/master/inst/etc/fig/" knitr::opts_chunk$set(fig.align = "center")
knitr::include_graphics(paste0(fig_dir, "logo.png"))
RcmdrPlugin.biostat is an Rcmdr plug-in for the most common data wrangling, visualization, and analysis tasks. It provides so-called BioStat (green) mode. In this mode, additional button bar appears:
knitr::include_graphics(paste0(fig_dir, "05--buttons-in-biostat-mode.png")) CAPTION <- "" # Figure caption/description.
NOTE: If an active dataset is not selected, some buttons are shaded in gray and are inactive.
This BioStat mode enables access to menus that use tidyverse family functions, as well as functions from other packages to perform some basic data wrangling, cleaning, plotting, preview and analysis tasks.
The documentation is available at gegznav.github.io/RcmdrPlugin.biostat{target="_blank"}.
Before you begin installation or updating, make sure that only a single R/RStudio session is running and restart the current R session (to unload the packages). It is also recommended to close the current RStudio project if you use one. Mac users need XQuartz{target="_blank"} to be installed (see also Notes for Mac users only) and opened during the installation. Windows users need Rtools{target="_blank"} if they want to install the package form GitHub.
The most convenient way is to install the pacage form CRAN-like repository:
repos <- c("https://mokymai.github.io/download/", getOption("repos")) install.packages("RcmdrPlugin.biostat", repos = repos)
If you want to install the development version of the package from “GitHub”, use:
# Update all necessary CRAN packages update.packages(ask = "graphics") # Install required packages if (!require("remotes")) install.packages("remotes") # Install RcmdrPlugin.biostat remotes::install_github( "GegznaV/RcmdrPlugin.biostat", dependencies = TRUE, upgrade = TRUE )
In case you face installation issues, follow the instructions in the error message.
You may also try removing upgrade = TRUE
{.r} and manually choose the packages to update.
It is always recommended to restart R session before the next installation too.
NOTE: the most common installation issue is related to R package rlang. Usually, you have to delete the indicated "00LOCK" directory (you may use
pacman::p_unlock()
{.r}{target="_blank"}, if you have package pacman{target="_blank"} installed, or delete the directory manually), restart the current R session and try to install again.
The easiest way to load RcmdrPlugin.biostat in BioStat (green) mode is to use RStudio addin:
knitr::include_graphics(paste0(fig_dir, "00-addin-to-load-biostat-mode.png")) CAPTION <- "" # Figure caption/description.
Alternatively, use code:
library(Rcmdr) library(RcmdrPlugin.biostat) load_rcmdr_biostat_mode()
Mac users should also read "Notes for Mac users only".
When RcmdrPlugin.biostat is loaded, you can access its functionality through either the BioStat button bar (find figure above) or through BioStat'20
menu in the menu bar (shown as BioStat'19
in the example):
knitr::include_graphics(paste0(fig_dir, "03--biostat-plugin-loaded.png")) CAPTION <- "" # Figure caption/description.
If you restarted R Commander and "BioStat" menu is present but button bar is missing, you may re-enable BioStat mode by selecting option "Mode: BioStat":
knitr::include_graphics(paste0(fig_dir, "04--activate-biostat-mode.png")) CAPTION <- "" # Figure caption/description.
To close this mode, simply restart the R Commander:
You may use the following command as well:
restart_commander()
For Mac users, there at least 2 things to pay attention to:
1) On Mac, R Commander opens only if XQuartz{target="_blank"} is opened. So, the first step of using R Commander is to make sure that XQuartz is opened. More information on "Installing R Commander for Mac users"{target="_blank"}.
2) Some Mac users also report that it is impossible to switch between languages while R Commander is running. This means, that some users might not use numbers if in the chosen language the same keys mean some non-English letters. Because of this, it is recommended to choose an appropriate language (usually English) before opening R/RStudio.
Other useful Rcmdr plug-ins:
a. RcmdrPlugin.EZR.as.menu -- an R Commander plugin for the most common statistical analyses (functionality is the same as in RcmdrPlugin.EZR, except that RcmdrPlugin.EZR.as.menu creates a separate "EZR" menu in a menu bar and does not reorganize the original Rcmdr menus in the menu bar); b. RcmdrPlugin.KMggplot2 -- an R Commander plugin for ggplot2 graphics.
To install these packages, use the following code:
# RcmdrPlugin.EZR.as.menu remotes::install_github("GegznaV/RcmdrPlugin.EZR", ref = "ezr_as_menu") # RcmdrPlugin.KMggplot2 install.packages("RcmdrPlugin.KMggplot2")
After the packages are installed, you can load them programmatically:
options(Rcmdr = list( plugins = c( "RcmdrPlugin.KMggplot2", "RcmdrPlugin.EZR.as.menu", "RcmdrPlugin.biostat", NULL ), console.output = FALSE )) library(Rcmdr)
If package Rcmdr is loaded and R Commander window is closed, instead of ~~library(Rcmdr)
~~, use this code exactly once:
Commander()
Some functions in the package are based on and modified from functions in packages Rcmdr, and RcmdrPlugin.EZR. All of those packages are under the GPL-2/GPL-3 license.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.