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