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

extending graph.decay.curves() #212

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ allpopsamples_hlye.csv$
^serocalculator.*\.tgz$
^inst/extdata
^CRAN-SUBMISSION$
^vignettes/rsconnect$
^rsconnect$
^README\.qmd$
^codecov\.yml$
^_quarto\.yml$
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ src-x64
serocalculator.Rcheck/
serocalculator*.tar.gz
serocalculator*.tgz
rsconnect
README.html
README_files

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: serocalculator
Title: Estimating Infection Rates from Serological Data
Version: 1.2.0.9018
Version: 1.2.0.9019
Authors@R: c(
person("Peter", "Teunis", , "p.teunis@emory.edu", role = c("aut", "cph"),
comment = "Author of the method and original code."),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export(load_curve_params)
export(load_noise_params)
export(load_pop_data)
export(log_likelihood)
export(plot_curve_params_one_ab)
export(sim.cs)
export(sim.cs.multi)
importFrom(Rcpp,sourceCpp)
Expand Down
18 changes: 10 additions & 8 deletions R/autoplot.curve_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
#' @param ncol how many columns of subfigures to use in panel plot
#' @details
#' ## `rows_to_graph`
#' Note that if you directly specify `rows_to_graph` when calling this function,
#' If you directly specify `rows_to_graph` when calling this function,
#' the row numbers are enumerated separately for each antigen isotype;
#' in other words, for the purposes of this argument,
#' row numbers start over at 1 for each antigen isotype. There is currently
#' no way to specify different row numbers for different antigen isotypes;
#' if you want to do that, you could call [plot_curve_params_one_ab()]
#' directly for each antigen isotype and combine the resulting panels yourself.
#' Or you could subset `curve_params` manually, before passing it to this
#' function, and set the `n_curves` argument to `Inf`.
#' row numbers start over at 1 for each antigen isotype.
#' There is currently no way to specify different row numbers for different antigen isotypes;

Check warning on line 13 in R/autoplot.curve_params.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/autoplot.curve_params.R,line=13,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 93 characters.
#' if you want to do that,
#' you will could call [plot_curve_params_one_ab()] directly for each antigen isotype

Check warning on line 15 in R/autoplot.curve_params.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/autoplot.curve_params.R,line=15,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 85 characters.
#' and combine the resulting panels yourself.
#' Or you could subset `curve_params` manually,
#' before passing it to this function,
#' and set the `n_curves` argument to `Inf`.
#' @return a [ggplot2::ggplot()] object
#' @export
#' @examples
Expand All @@ -25,7 +27,7 @@
#'
#' curve = load_curve_params("https://osf.io/download/rtw5k/") %>%
#' filter(antigen_iso %in% c("HlyE_IgA", "HlyE_IgG")) %>%
#' slice(1:100, .by = antigen_iso) %>% # Reduce dataset for this example
#' slice(1:100, .by = antigen_iso) %>% # Reduce dataset for this example
#' autoplot()
#'
#' curve
Expand Down
4 changes: 2 additions & 2 deletions R/graph.decay.curves.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
layer_function <- function(cur_row) {
cur_params <- object[cur_row, ]
ggplot2::geom_function(
alpha = alpha,

Check warning on line 71 in R/graph.decay.curves.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/graph.decay.curves.R,line=71,col=6,[indentation_linter] Hanging indent should be 27 spaces but is 6 spaces.
fun = ab0,
args = list(curve_params = cur_params),
n = n_points
)
n = n_points,
...)

Check warning on line 75 in R/graph.decay.curves.R

View check run for this annotation

Codecov / codecov/patch

R/graph.decay.curves.R#L74-L75

Added lines #L74 - L75 were not covered by tests
}

layers <-
Expand Down
18 changes: 10 additions & 8 deletions man/autoplot.curve_params.Rd

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

4 changes: 2 additions & 2 deletions man/plot_curve_params_one_ab.Rd

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

Loading