Skip to content

Commit

Permalink
address cran comments; recover lost codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Oct 31, 2020
1 parent 80ae276 commit edf953a
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 89 deletions.
5 changes: 1 addition & 4 deletions R/gghistostats.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,5 @@ gghistostats <- function(data,

# if any additional modification needs to be made to the plot
# this is primarily useful for grouped_ variant of this function
plot <- plot + ggplot.component

# return the final plot
return(plot)
plot + ggplot.component
}
5 changes: 3 additions & 2 deletions R/ggpiestats.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#' \url{https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html}
#'
#' @examples
#' \donttest{
#' # for reproducibility
#' set.seed(123)
#'
Expand All @@ -54,9 +55,9 @@
#' ggstatsplot::ggpiestats(
#' data = mtcars,
#' x = vs,
#' y = cyl,
#' legend.title = "Engine"
#' y = cyl
#' )
#' }
#' @export

# defining the function
Expand Down
2 changes: 2 additions & 0 deletions R/grouped_ggbarstats.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
#' dplyr::sample_frac(tbl = ., size = 0.05)
#'
#' # plot
#' # let's skip statistical analysis
#' ggstatsplot::grouped_ggbarstats(
#' data = diamonds_short,
#' x = color,
#' y = clarity,
#' grouping.var = cut,
#' results.subtitle = FALSE,
#' title.prefix = "Quality",
#' bar.label = "both",
#' plotgrid.args = list(nrow = 2)
Expand Down
4 changes: 3 additions & 1 deletion R/grouped_ggpiestats.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
#'
#' @examples
#' # grouped one-sample proportion test
#' # let's skip statistical analysis
#' ggstatsplot::grouped_ggpiestats(
#' data = mtcars,
#' grouping.var = am,
#' x = cyl
#' x = cyl,
#' results.subtitle = FALSE
#' )
#' @export

Expand Down
40 changes: 13 additions & 27 deletions R/helpers_gghistostats_graphics.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,15 @@ histo_labeller <- function(plot,
)

# adding a text label with mean value
plot <-
line_labeller(
plot = plot,
x = x.intercept,
y = y.label.position,
label.text = label.text,
k = centrality.k,
jitter = 0.25,
label.args = centrality.label.args
)

# return the plot with labels
return(plot)
line_labeller(
plot = plot,
x = x.intercept,
y = y.label.position,
label.text = label.text,
k = centrality.k,
jitter = 0.25,
label.args = centrality.label.args
)
}


Expand All @@ -147,9 +143,6 @@ histo_labeller <- function(plot,
#' @param jitter Numeric that specifies how much the label should be jittered in
#' the vertical direction (default: `0.25`). The sign will determine the
#' direction (upwards or downwards).
#' @param line.direction Character that specifies whether the line on which
#' label is to be attached is vertical (`"vline"`, default) or horizontal
#' (`"hline"`) line.
#' @inheritParams gghistostats
#'
#' @import ggplot2
Expand All @@ -176,22 +169,15 @@ histo_labeller <- function(plot,
line_labeller <- function(plot,
x,
y,
k = 2,
k = 2L,
label.text,
label.args = list(),
line.direction = "vline",
jitter = 0.25,
...) {
# assigning `x` and `y` values to new position variables to avoid confusion
if (line.direction == "vline") {
x_pos <- x
y_pos <- y * (1 + jitter)
label.value <- x_pos
} else {
x_pos <- x * (1 + jitter)
y_pos <- y
label.value <- y_pos
}
x_pos <- x
y_pos <- y * (1 + jitter)
label.value <- x_pos

# adding label to the plot
plot +
Expand Down
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ ggstatsplot::grouped_ggwithinstats(
outlier.tagging = TRUE,
outlier.label = education,
ggtheme = hrbrthemes::theme_ipsum_tw(),
ggstatsplot.layer = FALSE,
messages = FALSE
ggstatsplot.layer = FALSE
)
```

Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
| Package | Status | Usage | GitHub | References |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![CRAN\_Release\_Badge](https://www.r-pkg.org/badges/version-ago/ggstatsplot)](https://CRAN.R-project.org/package=ggstatsplot) | [![Travis Build Status](https://travis-ci.org/IndrajeetPatil/ggstatsplot.svg?branch=master)](https://travis-ci.org/IndrajeetPatil/ggstatsplot) | [![Daily downloads badge](https://cranlogs.r-pkg.org/badges/last-day/ggstatsplot?color=blue)](https://CRAN.R-project.org/package=ggstatsplot) | [![GitHub version](https://img.shields.io/badge/GitHub-0.6.5.9000-orange.svg?style=flat-square)](https://github.com/IndrajeetPatil/ggstatsplot/) | [![Website](https://img.shields.io/badge/website-ggstatsplot-orange.svg?colorB=E91E63)](https://indrajeetpatil.github.io/ggstatsplot/) |
| [![CRAN Checks](https://cranchecks.info/badges/summary/ggstatsplot)](https://cran.r-project.org/web/checks/check_results_ggstatsplot.html) | [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/IndrajeetPatil/ggstatsplot?branch=master&svg=true)](https://ci.appveyor.com/project/IndrajeetPatil/ggstatsplot) | [![Weekly downloads badge](https://cranlogs.r-pkg.org/badges/last-week/ggstatsplot?color=blue)](https://CRAN.R-project.org/package=ggstatsplot) | [![Forks](https://img.shields.io/badge/forks-118-blue.svg)](https://github.com/IndrajeetPatil/ggstatsplot/) | [![Features](https://img.shields.io/badge/features-ggstatsplot-orange.svg?colorB=2196F3)](https://indrajeetpatil.github.io/ggstatsplot/reference/index.html) |
| [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.5.0-6666ff.svg)](https://cran.r-project.org/) | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/) | [![Monthly downloads badge](https://cranlogs.r-pkg.org/badges/last-month/ggstatsplot?color=blue)](https://CRAN.R-project.org/package=ggstatsplot) | [![Github Issues](https://img.shields.io/badge/issues-24-red.svg)](https://github.com/IndrajeetPatil/ggstatsplot/issues) | [![vignettes](https://img.shields.io/badge/vignettes-0.6.5-orange.svg?colorB=FF5722)](https://CRAN.R-project.org/package=ggstatsplot/vignettes/) |
| [![CRAN Checks](https://cranchecks.info/badges/summary/ggstatsplot)](https://cran.r-project.org/web/checks/check_results_ggstatsplot.html) | [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/IndrajeetPatil/ggstatsplot?branch=master&svg=true)](https://ci.appveyor.com/project/IndrajeetPatil/ggstatsplot) | [![Weekly downloads badge](https://cranlogs.r-pkg.org/badges/last-week/ggstatsplot?color=blue)](https://CRAN.R-project.org/package=ggstatsplot) | [![Forks](https://img.shields.io/badge/forks-119-blue.svg)](https://github.com/IndrajeetPatil/ggstatsplot/) | [![Features](https://img.shields.io/badge/features-ggstatsplot-orange.svg?colorB=2196F3)](https://indrajeetpatil.github.io/ggstatsplot/reference/index.html) |
| [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.6.0-6666ff.svg)](https://cran.r-project.org/) | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/) | [![Monthly downloads badge](https://cranlogs.r-pkg.org/badges/last-month/ggstatsplot?color=blue)](https://CRAN.R-project.org/package=ggstatsplot) | [![Github Issues](https://img.shields.io/badge/issues-25-red.svg)](https://github.com/IndrajeetPatil/ggstatsplot/issues) | [![vignettes](https://img.shields.io/badge/vignettes-0.6.5-orange.svg?colorB=FF5722)](https://CRAN.R-project.org/package=ggstatsplot/vignettes/) |
| [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/IndrajeetPatil/ggstatsplot.svg)](https://github.com/IndrajeetPatil/ggstatsplot) | [![Coverage Status](https://coveralls.io/repos/github/IndrajeetPatil/ggstatsplot/badge.svg?branch=master)](https://coveralls.io/github/IndrajeetPatil/ggstatsplot?branch=master) | [![Total downloads badge](https://cranlogs.r-pkg.org/badges/grand-total/ggstatsplot?color=blue)](https://CRAN.R-project.org/package=ggstatsplot) | [![Github Stars](https://img.shields.io/github/stars/IndrajeetPatil/ggstatsplot.svg?style=social&label=Github)](https://github.com/IndrajeetPatil/ggstatsplot) | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2074621.svg)](https://doi.org/10.5281/zenodo.2074621) |
| [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) | [![Codecov test coverage](https://codecov.io/gh/IndrajeetPatil/ggstatsplot/branch/master/graph/badge.svg)](https://codecov.io/gh/IndrajeetPatil/ggstatsplot?branch=master) | [![HitCount](https://hits.dwyl.com/IndrajeetPatil/ggstatsplot.svg)](https://hits.dwyl.com/IndrajeetPatil/ggstatsplot) | [![Last-changedate](https://img.shields.io/badge/last%20change-2020--10--30-yellowgreen.svg)](https://github.com/IndrajeetPatil/ggstatsplot/commits/master) | [![GitHub last commit](https://img.shields.io/github/last-commit/IndrajeetPatil/ggstatsplot.svg)](https://github.com/IndrajeetPatil/ggstatsplot/commits/master) |
| [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) | [![Codecov test coverage](https://codecov.io/gh/IndrajeetPatil/ggstatsplot/branch/master/graph/badge.svg)](https://codecov.io/gh/IndrajeetPatil/ggstatsplot?branch=master) | [![HitCount](https://hits.dwyl.com/IndrajeetPatil/ggstatsplot.svg)](https://hits.dwyl.com/IndrajeetPatil/ggstatsplot) | [![Last-changedate](https://img.shields.io/badge/last%20change-2020--10--31-yellowgreen.svg)](https://github.com/IndrajeetPatil/ggstatsplot/commits/master) | [![GitHub last commit](https://img.shields.io/github/last-commit/IndrajeetPatil/ggstatsplot.svg)](https://github.com/IndrajeetPatil/ggstatsplot/commits/master) |
| [![status](https://tinyverse.netlify.com/badge/ggstatsplot)](https://CRAN.R-project.org/package=ggstatsplot) | [![R build status](https://github.com/IndrajeetPatil/ggstatsplot/workflows/R-CMD-check/badge.svg)](https://github.com/IndrajeetPatil/ggstatsplot) | [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/ggstatsplot/community) | [![Project Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/IndrajeetPatil/ggstatsplot/issues) |

# Raison d’être <img src="man/figures/logo.png" align="right" width="360" />
Expand Down Expand Up @@ -259,7 +259,7 @@ ggstatsplot::ggbetweenstats(
mean.ci = TRUE, # whether to display confidence interval for means
k = 3, # number of decimal places for statistical results
outlier.tagging = TRUE, # whether outliers need to be tagged
outlier.label = dose, # variable to be used for the outlier tag
outlier.label = dose, # variable to be used for tagging outliers
xlab = "Supplement type", # label for the x-axis variable
ylab = "Tooth length", # label for the y-axis variable
title = "The Effect of Vitamin C on Tooth Growth", # title text for the plot
Expand Down Expand Up @@ -371,8 +371,7 @@ ggstatsplot::ggwithinstats(
title = "Wine tasting",
caption = "Data source: `WRS2` R package",
ggtheme = ggthemes::theme_fivethirtyeight(),
ggstatsplot.layer = FALSE,
messages = FALSE
ggstatsplot.layer = FALSE
)
```

Expand Down Expand Up @@ -402,8 +401,7 @@ ggstatsplot::grouped_ggwithinstats(
outlier.tagging = TRUE,
outlier.label = education,
ggtheme = hrbrthemes::theme_ipsum_tw(),
ggstatsplot.layer = FALSE,
messages = FALSE
ggstatsplot.layer = FALSE
)
```

Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,5 @@
],
"funder": {},
"readme": "https://github.com/IndrajeetPatil/ggstatsplot/blob/master/README.md",
"fileSize": "58412.286KB"
"fileSize": "58281.289KB"
}
16 changes: 7 additions & 9 deletions docs/index.html

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

Loading

4 comments on commit edf953a

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-raw/Titanic_full.R:16:10: warning: 1:nrow(...) is likely to be wrong in the empty edge case, use seq_len.

df[rep(1:nrow(df), rep), ]
         ^

R/ggbetweenstats.R:159:1: style: functions should have cyclomatic complexity of less than 15, this has 24.

ggbetweenstats <- function(data,
^

R/ggcoefstats.R:204:1: style: functions should have cyclomatic complexity of less than 15, this has 37.

ggcoefstats <- function(x,
^

R/ggpiestats.R:64:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggpiestats <- function(data,
^

R/ggscatterstats.R:89:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggscatterstats <- function(data,
^

R/ggwithinstats.R:66:1: style: functions should have cyclomatic complexity of less than 15, this has 20.

ggwithinstats <- function(data,
^

R/helpers_gghistostats_graphics.R:180:3: warning: local variable ‘label.value’ assigned but may not be used

label.value <- x_pos
  ^~~~~~~~~~~

tests/testthat/test-ggbetweenstats.R:154:13: style: Commented code should be removed.

#       bold("only significant")
            ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-ggwithinstats.R:379:15: style: Commented code should be removed.

#       bold("only significant")
              ^~~~~~~~~~~~~~~~~~~~~~~~

vignettes/web_only/combine_plots.Rmd:98:17: style: Do not place spaces around code in parentheses or square brackets.

dplyr::mutate( 
                ^

vignettes/web_only/ggcoefstats.Rmd:309:3: style: Commented code should be removed.

# data("raceDolls")
  ^~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:314:7: style: Commented code should be removed.

#     fixedMargin = "cols"
      ^~~~~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:1566:20: style: Place a space before left parenthesis, except in a function call.

p <- 1 / (1 + exp(-(beta[1] + beta[2] * x)))
                   ^

vignettes/web_only/ggcoefstats.Rmd:2196:28: style: Place a space before left parenthesis, except in a function call.

gradtol.weights = 10^(-6)
                           ^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-raw/Titanic_full.R:16:10: warning: 1:nrow(...) is likely to be wrong in the empty edge case, use seq_len.

df[rep(1:nrow(df), rep), ]
         ^

R/ggbetweenstats.R:159:1: style: functions should have cyclomatic complexity of less than 15, this has 24.

ggbetweenstats <- function(data,
^

R/ggcoefstats.R:204:1: style: functions should have cyclomatic complexity of less than 15, this has 37.

ggcoefstats <- function(x,
^

R/ggpiestats.R:64:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggpiestats <- function(data,
^

R/ggscatterstats.R:89:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggscatterstats <- function(data,
^

R/ggwithinstats.R:66:1: style: functions should have cyclomatic complexity of less than 15, this has 20.

ggwithinstats <- function(data,
^

R/helpers_gghistostats_graphics.R:180:3: warning: local variable ‘label.value’ assigned but may not be used

label.value <- x_pos
  ^~~~~~~~~~~

tests/testthat/test-ggbetweenstats.R:154:13: style: Commented code should be removed.

#       bold("only significant")
            ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-ggwithinstats.R:379:15: style: Commented code should be removed.

#       bold("only significant")
              ^~~~~~~~~~~~~~~~~~~~~~~~

vignettes/web_only/combine_plots.Rmd:98:17: style: Do not place spaces around code in parentheses or square brackets.

dplyr::mutate( 
                ^

vignettes/web_only/ggcoefstats.Rmd:309:3: style: Commented code should be removed.

# data("raceDolls")
  ^~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:314:7: style: Commented code should be removed.

#     fixedMargin = "cols"
      ^~~~~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:1566:20: style: Place a space before left parenthesis, except in a function call.

p <- 1 / (1 + exp(-(beta[1] + beta[2] * x)))
                   ^

vignettes/web_only/ggcoefstats.Rmd:2196:28: style: Place a space before left parenthesis, except in a function call.

gradtol.weights = 10^(-6)
                           ^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-raw/Titanic_full.R:16:10: warning: 1:nrow(...) is likely to be wrong in the empty edge case, use seq_len.

df[rep(1:nrow(df), rep), ]
         ^

R/ggbetweenstats.R:159:1: style: functions should have cyclomatic complexity of less than 15, this has 24.

ggbetweenstats <- function(data,
^

R/ggcoefstats.R:204:1: style: functions should have cyclomatic complexity of less than 15, this has 37.

ggcoefstats <- function(x,
^

R/ggpiestats.R:64:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggpiestats <- function(data,
^

R/ggscatterstats.R:89:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggscatterstats <- function(data,
^

R/ggwithinstats.R:66:1: style: functions should have cyclomatic complexity of less than 15, this has 20.

ggwithinstats <- function(data,
^

R/helpers_gghistostats_graphics.R:180:3: warning: local variable ‘label.value’ assigned but may not be used

label.value <- x_pos
  ^~~~~~~~~~~

tests/testthat/test-ggbetweenstats.R:154:13: style: Commented code should be removed.

#       bold("only significant")
            ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-ggwithinstats.R:379:15: style: Commented code should be removed.

#       bold("only significant")
              ^~~~~~~~~~~~~~~~~~~~~~~~

vignettes/web_only/combine_plots.Rmd:98:17: style: Do not place spaces around code in parentheses or square brackets.

dplyr::mutate( 
                ^

vignettes/web_only/ggcoefstats.Rmd:309:3: style: Commented code should be removed.

# data("raceDolls")
  ^~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:314:7: style: Commented code should be removed.

#     fixedMargin = "cols"
      ^~~~~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:1566:20: style: Place a space before left parenthesis, except in a function call.

p <- 1 / (1 + exp(-(beta[1] + beta[2] * x)))
                   ^

vignettes/web_only/ggcoefstats.Rmd:2196:28: style: Place a space before left parenthesis, except in a function call.

gradtol.weights = 10^(-6)
                           ^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-raw/Titanic_full.R:16:10: warning: 1:nrow(...) is likely to be wrong in the empty edge case, use seq_len.

df[rep(1:nrow(df), rep), ]
         ^

R/ggbetweenstats.R:159:1: style: functions should have cyclomatic complexity of less than 15, this has 24.

ggbetweenstats <- function(data,
^

R/ggcoefstats.R:204:1: style: functions should have cyclomatic complexity of less than 15, this has 37.

ggcoefstats <- function(x,
^

R/ggpiestats.R:64:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggpiestats <- function(data,
^

R/ggscatterstats.R:89:1: style: functions should have cyclomatic complexity of less than 15, this has 22.

ggscatterstats <- function(data,
^

R/ggwithinstats.R:66:1: style: functions should have cyclomatic complexity of less than 15, this has 20.

ggwithinstats <- function(data,
^

R/helpers_gghistostats_graphics.R:180:3: warning: local variable ‘label.value’ assigned but may not be used

label.value <- x_pos
  ^~~~~~~~~~~

tests/testthat/test-ggbetweenstats.R:154:13: style: Commented code should be removed.

#       bold("only significant")
            ^~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-ggwithinstats.R:379:15: style: Commented code should be removed.

#       bold("only significant")
              ^~~~~~~~~~~~~~~~~~~~~~~~

vignettes/web_only/combine_plots.Rmd:98:17: style: Do not place spaces around code in parentheses or square brackets.

dplyr::mutate( 
                ^

vignettes/web_only/ggcoefstats.Rmd:309:3: style: Commented code should be removed.

# data("raceDolls")
  ^~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:314:7: style: Commented code should be removed.

#     fixedMargin = "cols"
      ^~~~~~~~~~~~~~~~~~~~

vignettes/web_only/ggcoefstats.Rmd:1566:20: style: Place a space before left parenthesis, except in a function call.

p <- 1 / (1 + exp(-(beta[1] + beta[2] * x)))
                   ^

vignettes/web_only/ggcoefstats.Rmd:2196:28: style: Place a space before left parenthesis, except in a function call.

gradtol.weights = 10^(-6)
                           ^

Please sign in to comment.