Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for CMD CHECK #6

Merged
merged 2 commits into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
Package: ggtrace
Type: Package
Title: Trace Data Points
Package: ggtrace
Title: Trace groups of geoms from 'ggplot2'
Version: 0.0.0.9000
Authors@R:
c(person(given = "Ryan",
family = "Sheridan",
role = c("aut", "cre"),
email = "ryan.sheridan@cuanschutz.edu",
comment = c(ORCID = "0000-0003-4012-3147")))
Description: A geom to outline groups of data points
person(given = "Ryan",
family = "Sheridan",
role = c("aut", "cre"),
email = "ryan.sheridan@cuanschutz.edu",
comment = c(ORCID = "0000-0003-4012-3147"))
Description: Provides a geom for 'ggplot2' that improves the clarity of
plots with many overlapping geoms.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Imports:
ggplot2,
grid,
rlang
RoxygenNote: 7.1.1
Depends:
R (>= 4.0.0)
Imports:
ggplot2,
grid
Suggests:
testthat (>= 3.0.0),
covr
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
Config/testthat/edition: 3
23 changes: 5 additions & 18 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
# Generated by roxygen2: do not edit by hand

export(":=")
export(.data)
export(GeomPointTrace)
export(as_label)
export(as_name)
export(enquo)
export(enquos)
export(expr)
export(geom_point_trace)
export(sym)
export(syms)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(rlang,as_label)
importFrom(rlang,as_name)
importFrom(rlang,enquo)
importFrom(rlang,enquos)
importFrom(rlang,expr)
importFrom(rlang,sym)
importFrom(rlang,syms)
import(ggplot2)
importFrom(grid,gpar)
importFrom(grid,grobName)
importFrom(grid,grobTree)
importFrom(grid,pointsGrob)
15 changes: 9 additions & 6 deletions R/geom_point_trace.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Highlight points
#' Trace points to improve clarity of plots with overplotted geoms.
#'
#' @param mapping Set of aesthetic mappings created by [aes()] or
#' [aes_()]. If specified and `inherit.aes = TRUE` (the
Expand All @@ -18,7 +18,6 @@
#' the plot data. The return value must be a `data.frame`, and
#' will be used as the layer data. A `function` can be created
#' from a `formula` (e.g. `~ head(.x, 10)`).
#' @param geom The geometric object to use display the data
#' @param stat The statistical transformation to use on the data for this
#' layer, as a string.
#' @param position Position adjustment, either as a string, or the result of
Expand All @@ -41,6 +40,7 @@
#' rather than combining with them. This is most useful for helper functions
#' that define both data and aesthetics and shouldn't inherit behaviour from
#' the default plot specification, e.g. [borders()].
#' @rdname geom_point_trace
#' @export
# https://stackoverflow.com/questions/67573707/ggplot-extension-function-to-plot-a-superimposed-mean-in-a-scatterplot
geom_point_trace <- function(mapping = NULL, data = NULL, stat = "identity", position = "identity",
Expand All @@ -66,6 +66,7 @@ geom_point_trace <- function(mapping = NULL, data = NULL, stat = "identity", pos
)
}

#' GeomPointTrace
#' @rdname ggplot2-ggproto
#' @format NULL
#' @usage NULL
Expand Down Expand Up @@ -143,7 +144,8 @@ GeomPointTrace <- ggplot2::ggproto(
draw_key = ggplot2::draw_key_point
)

# Helper to adjust shape specification
#' Helper to adjust shape specification
#' @noRd
translate_trace_shape <- function(pch) {
pch_tbl <- c(
"0" = 0, # "square open"
Expand Down Expand Up @@ -195,9 +197,10 @@ translate_trace_shape <- function(pch) {
res
}

# Name ggplot grid object
# Helper to name grid objects
# https://github.com/tidyverse/ggplot2/blob/master/R/utilities-grid.r
#' Name ggplot grid object
#' Helper to name grid objects
#' https://github.com/tidyverse/ggplot2/blob/master/R/utilities-grid.r
#' @noRd
ggname <- function(prefix, grob) {
grob$name <- grid::grobName(grob, prefix)
grob
Expand Down
28 changes: 28 additions & 0 deletions R/ggtrace-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#' ggtrace
#'
#' This package contains extra geoms for \pkg{ggplot2}.
#'
#' Please see the help pages listed below:
#'
#' \itemize{
#' \item \code{\link{geom_point_trace}}
#' }
#'
#' Also see the vignette for more usage examples:
#'
#' \code{browseVignettes("ggtrace")}
#'
#' Please report issues and suggest improvements at Github:
#'
#' \url{https://github.com/rnabioco/ggtrace}
#'
#' @name ggtrace
#' @docType package
#' @import ggplot2
#' @importFrom grid
#' gpar
#' pointsGrob
#' grobName
#' grobTree
#' @keywords internal
"_PACKAGE"
47 changes: 0 additions & 47 deletions R/utils-tidy-eval.R

This file was deleted.

3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ knitr::opts_chunk$set(
# ggtrace

<!-- badges: start -->
[![R build
status](https://github.com/rnabioco/ggtrace/workflows/R-CMD-check/badge.svg)](https://github.com/rnabioco/ggtrace/actions)
[![R-CMD-check](https://github.com/rnabioco/ggtrace/workflows/R-CMD-check/badge.svg)](https://github.com/rnabioco/ggtrace/actions)
[![Codecov test coverage](https://codecov.io/gh/rnabioco/ggtrace/branch/master/graph/badge.svg)](https://codecov.io/gh/rnabioco/ggtrace?branch=master)
<!-- badges: end -->

Expand Down
6 changes: 2 additions & 4 deletions man/geom_point_trace.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions man/ggplot2-ggproto.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions man/ggtrace.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 0 additions & 51 deletions man/tidyeval.Rd

This file was deleted.

4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat)
library(ggtrace)

test_check("ggtrace")
3 changes: 3 additions & 0 deletions tests/testthat/test-geom_point_trace.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test_that("unexpected args throw warning", {
expect_warning(ggplot() + geom_point_trace(blah = "blerg"))
})