Learn R Programming

qwraps2 (version 0.6.1)

qwraps2-package: A collection of wrapper functions aimed at for aiding the authoring of reproducible reports.

Description

qwraps2 is a collection of helpful functions when working on a varied collection of different analysis reports. There are two types of functions, helpful data summary functions, formatting results from regression models, and ggplot2 wrappers.

Arguments

Options

There are several options which can be set via options and will be used via getOption. The following lists, in alphabetical order the different options which are available and what they control.

  • getOptions("qwraps2_alpha", 0.05) significance level, used for generating (1 - getOptions("qwraps2_alpha", 0.05)) * 100% confidence intervals, and determining significance for p-value < getOptions("qwraps2_alpha", 0.05).

  • getOptions("qwraps2_frmt_digits", 2) Number of digits to the right of the decimal point for any value other than p-values.

  • getOptions("qwraps2_frmtp_case", "upper") set to either 'upper' or 'lower' for the case of the 'P' for reporting p-values.

  • getOptions("qwraps2_frmtp_digits", 4) Number of digits to the right of the decimal point to report p-values too. If log10(p-value) < getOptions("qwraps2_frmtp_digits", 4) then the output will be "P < 0.01", to however many digits are correct. Other options control other parts of the output p-value format.

  • getOptions("qwraps2_frmtp_leading0", TRUE) to display or not to display the leading zero in p-values, i.e., if TRUE p-values are reported as 0.02 versus when FALSE p-values are reported as .02.

  • getOptions("qwraps2_journal", "default") if a journal has specific formatting for p-values or other statistics, this option will control the output. Many other options are ignored if this is any other than default. Check the github wiki, or this file, for current lists of implemented journal style methods.

  • getOptions("qwraps2_markup", "latex") value set to 'latex' or to 'markdown'. Output is formatted to meet requirements of either markup language.

  • getOptions("qwraps2_style", "default") By setting this option to a specific journal, p-values and other output, will be formatted to meet journal requirements.

Journals with predefined formatting

  • Obstetrics & Gynecology

    • https://www.editorialmanager.com/ong/default.aspx

    • options(qwraps2_journal = "obstetrics_gynecology")

    • P-value formatting as of April 2015:

      Express P values to no more than three decimal places.

      Based on observations of published work, leading 0 will be omitted.

  • Pediatric Dentistry:

    • http://www.aapd.org/publications/

    • options(qwraps2_journal = "pediatric_dentistry")

    • P-value formatting as of March 2015.

      If P > .01, the actual value for P should be expressed to 2 digits. Non-significant values should not be expressed as "NS" whether or note P is significant, unless rounding a significant P-value expressed to 3 digits would make it non significant (i.e., P=.049, not P=.05). If P<.01, it should be express to 3 digits (e.g., P=.003, not P<.05). Actual P-values should be expressed unless P<.001, in which case they should be so designated.

Author

Maintainer: Peter DeWitt dewittpe@gmail.com (ORCID)

Other contributors:

Details

Several wrappers for ggplot2 style graphics, such as ROC, AUC, Bland-Altman, and KM plots are provided. Named as qroc, qacf, qblandaltman and qkmplot to pay homage to qplot form ggplot2 and the standard names for such plots.

Other functions are used to quickly generate meaningful character strings for outputting results in .Rnw, .Rmd, or other similar functions.

See Also