From f0da4582180814f6fe6942e05adcb397d81ed98f Mon Sep 17 00:00:00 2001 From: AG Damsbo Date: Fri, 28 Oct 2022 12:23:22 +0200 Subject: [PATCH] new function source_lines() and version bump. --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/source_lines.R | 14 +++++ docs/404.html | 2 +- docs/authors.html | 6 +- docs/index.html | 2 +- docs/pkgdown.yml | 2 +- docs/reference/age_calc.html | 2 +- docs/reference/ci_plot.html | 2 +- docs/reference/cpr_check.html | 2 +- docs/reference/cpr_dob.html | 2 +- docs/reference/cpr_female.html | 2 +- docs/reference/cprs.html | 2 +- docs/reference/generic_stroke.html | 94 ++++++++++++++--------------- docs/reference/index.html | 7 ++- docs/reference/plot_olr-1.png | Bin 86654 -> 85527 bytes docs/reference/plot_olr.html | 2 +- docs/reference/quantile_cut.html | 6 +- docs/reference/source_lines.html | 91 ++++++++++++++++++++++++++++ docs/reference/stRoke-package.html | 2 +- docs/reference/talos.html | 2 +- docs/search.json | 2 +- docs/sitemap.xml | 3 + man/source_lines.Rd | 22 +++++++ 24 files changed, 204 insertions(+), 68 deletions(-) create mode 100644 R/source_lines.R create mode 100644 docs/reference/source_lines.html create mode 100644 man/source_lines.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 5b90078..72956c4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: stRoke Title: Tools for work in clinical stroke research -Version: 0.22.9.5 +Version: 0.22.10.1 Authors@R: person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7559-1154")) diff --git a/NAMESPACE b/NAMESPACE index da92cd4..e0d08ff 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,6 +8,7 @@ export(cpr_female) export(generic_stroke) export(plot_olr) export(quantile_cut) +export(source_lines) import(ggplot2) import(stats) importFrom(MASS,polr) diff --git a/R/source_lines.R b/R/source_lines.R new file mode 100644 index 0000000..ee96989 --- /dev/null +++ b/R/source_lines.R @@ -0,0 +1,14 @@ +#' Source only specific lines from an R file +#' +#' Copied from a gist by christophergandrud (https://gist.github.com/christophergandrud/1eb4e095974204b12af9) +#' This function is really helpfull when working on eg sst.dk-servers. You can not load packages, so you have to re-write this function. It is short, and you will manage! +#' @param file character string with path to the source file +#' @param lines numeric vector of the lines to source from 'file' +#' @param ... further arguments to be passed to source +#' +#' @return list +#' @export +#' +source_lines <- function(file, lines, ...){ + source(textConnection(readLines(file)[lines]), ...) +} diff --git a/docs/404.html b/docs/404.html index d2ea8a5..8f77ea4 100644 --- a/docs/404.html +++ b/docs/404.html @@ -24,7 +24,7 @@ stRoke - 0.22.9.5 + 0.22.10.1 + + + + + +
+
+
+ +
+

Copied from a gist by christophergandrud (https://gist.github.com/christophergandrud/1eb4e095974204b12af9) +This function is really helpfull when working on eg sst.dk-servers. You can not load packages, so you have to re-write this function. It is short, and you will manage!

+
+ +
+

Usage

+
source_lines(file, lines, ...)
+
+ +
+

Arguments

+
file
+

character string with path to the source file

+ + +
lines
+

numeric vector of the lines to source from 'file'

+ + +
...
+

further arguments to be passed to source

+ +
+
+

Value

+ + +

list

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/docs/reference/stRoke-package.html b/docs/reference/stRoke-package.html index 6b5063a..198cce9 100644 --- a/docs/reference/stRoke-package.html +++ b/docs/reference/stRoke-package.html @@ -10,7 +10,7 @@ stRoke - 0.22.9.5 + 0.22.10.1