ggpmisc 0.3.9

Package ‘ggpmisc’ focuses mainly on plot annotations. The new version fixes minor bugs and adds a major new feature: position functions for data aware nudging. These nudge functions were born out of an exchange of ideas with Kamil Slowikowski, the author and maintainer of the very popular package ‘ggrepel’. We are currently considering how to make them compatible with geom_text_repel() and geom_label_repel().

The package documentation web site at: https://docs.r4photobiology.info/ggpmisc/ now includes a changelog, so I am brief here.

Changes from version 0.3.8, the most recent CRAN release, are:

  • Update the documentation of geom_plot().
  • [Under development!] Link repositioned text to its original position with a segment or arrow: geom_linked_text(). Except for
    the drawing of segments or arrows this new geometry behaves as ggplot2::geom_text() . Note: Segments and arrows are drawn only
    if the position function used returns both the repositioned and original coordinates.
  • Add support for advanced nudging: position_nudge_centre() and position_nudge_line() compute the direction of nudging and return
    both the nudged and original positions.
  • Add support for simple nudging: position_nudge_to() nudges to new user-supplied position(s); position_nudge_keep() nudges to
    position(s) based on user-supplies position shift. These functions return both nudged and original position(s).

Example: Nudging text labels away from a curve.

library(ggpmisc)

set.seed(16532)
df <- data.frame(
  x = -10:10,
  y = (-10:10)^2 + rnorm(21, 0, 4),
  l = letters[1:21]
)

ggplot(df, aes(x, y, label = l)) +
  geom_point() +
  stat_smooth(method = "lm", formula = y ~ poly(x, 2, raw = TRUE)) +
  geom_text(aes(y = y, label = l),
            position = position_nudge_line(method = "lm",
                                           x = 0.4, 
                                           y = 4,
                                           formula = y ~ poly(x, 2, raw = TRUE),
                                           direction = "split"))
The resulting plot.
Nudging of text labels away from a curve.

Roadmap: A split of the ‘ggpmisc’ package into two packages, one including the extensions to the grammar of graphics and another one including the functions related to plot annotations based on model fitting and statistical summaries seems necessary as the package has grown to include several extensions to the grammar of graphics that are generally useful. We are also working on improved inter-operation between ‘ggpmisc’ and ‘ggrepel’.

Acknowlegement: I thank Kamil Slowikowski for his contributions of ideas and for his willingness to keep the development of our packages coordinated. This update was done in part to address questions raised and reports of bugs by users, which I thank. The tag [ggpmisc] is in use at stackoverflow for questions related to the use this package. Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/ggpmisc/issues. Pull requests are also welcome.

Documentation web site at http://docs.r4photobiology.info/ggpmisc/ includes all help pages, with output from all examples, and vignettes in HTML format. The online vignettes include the output of all code examples, while the vignettes as included in the package, contain the output of only a subset of the code examples so as to keep the documentation at a reasonable size for package distribution.

NOTE: The new version of the package is on its way to CRAN.

ooacquire 0.2.3

Main changes since version 0.2.2 are:

  • Implement support for on-the-fly retrieval of instrument descriptor and calibration data from EEPROM when calibration is not available as R objects: update acq_irrad_interactive() and the functions it uses to retrieve and save calibration data.  (Similar updates are pending for the other data acquisition functions).
  • Update calibration data for MAYP11278 and MAYP112785.
  • Test with old USB2000 spectrometer.

Full change history is available at: https://docs.r4photobiology.info/ooacquire/news/index.html

NOTE: This package is NOT available through CRAN.

This package is available through the r4photobiology repository  and through GitHub.

INSTALLATION:

Note: this version needs the recently released ‘rOmniDriver’ version 0.1.14 or later, so if this package is already installed it may need to be updated before updating or installing ‘ooacquire’ 0.2.3.

  1. From the binary or source packages of the released version from the CRAN-compatible repository at http://r.r4photobiology.info/.
  2. From sources of the under development version retrieved from the Git repository at GitHub.

devtools::install_github("aphalo/romnidriver")
devtools::install_github("aphalo/ooacquire")

Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/ooacquire/issues

 

ooacquire 0.2.2

During the last two years development has continued at a slow pace. Most changes are to the functions for interactive acquisition of spectra, correction of bugs and tracking to changes in packages from which imports are made. Testing was done with new OmniDriver releases. Some data examples have been added and also replaced. Some progress with the vignettes has been done. However, the documentation still needs work.

One visible change is the move of the Git repository from Bitbucket to GitHub. Package ‘rOmniDriver’ has also been moved to GitHub and its documentation updated to reflect this.

Starting from this release, the changelog is included in the online documentation at http://docs.r4photobiology.info/ooacquire/.

Please raise issues concerning bugs or enhancements to this package through GitHub at https://github.com/aphalo/ooacquire/issues

NOTE: This package is NOT available through CRAN.

This package is available through the r4photobiology repository  and through GitHub.

INSTALLATION:

  1. From the binary or source packages of the released version from the CRAN-compatible repository at http://r.r4photobiology.info/.
  2. From sources of the under development version retrieved from the Git repository at GitHub.

devtools::install_github("aphalo/romnidriver")
devtools::install_github("aphalo/ooacquire")

ggpmisc 0.3.2

This version (0.3.2) adds as new features scales and statistics that help with the creation of volcano and quadrant plots, such as used with transcriptomics and metabolomics data. A few rough edges remaining in the features added in versions 0.3.0. and 0.3.1 have been polished out. Two issues raised in Bitbucket about the documentation, highlighted some incomplete explanations. These explanations have now been expanded. One important change to the documentation of statistics whose returned values may change depending on arguments is the addition of an example of the use of geom_debug() from package ‘gginnards’ showing how to print to the R console the data returned by statistics, which is the input received by the paired geometries. The User Guide needs still some work, scheduled for the next release. Package documentation is available at https://docs.r4photobiology.info/ggpmisc/ as a web site.

Plots created using the new statistics and scales are shown below. In the quadrant plot, which observations were labelled and highlighted was decided automatically based on local 2D density. Counts for each quadrant are computed on the fly. As the plot is non-the-less created using the grammar of graphics, little if any of the flexibility of ‘ggplot2’ is lost.

Quadrant plot created with packages ‘ggplot2 (3.2.1)’, ‘ggpmisc (0.3.2)’ and ‘ggrepel (0.8.1)’.
Volcano plot created with packages ‘ggplot2’, ‘ggpmisc’ and ‘ggrepel’ (very small p-values have been squished to the top edge of the plotting area).

NOTE: The new version of ‘ggpmisc’ is on its way to CRAN.

Back to Top