ISAAKiel / oxcAAR
Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -3,13 +3,22 @@
Loading
3 3
#' Takes an Oxcal Script, hands it over to oxcal and receives the output that is read from the output file
4 4
#'
5 5
#' @param oxcal_script A string containing the Oxcal commands that should be processed.
6 +
#' @param file A string naming a file for writing. Elements of the path other
7 +
#'  than the last will be created if needed. If `NULL` (the default),
8 +
#'  a temporary file will be used.
6 9
#' @return The path to the js output file
7 10
#'
8 11
#' @author Martin Hinz
9 12
#' @export
10 -
executeOxcalScript <- function(oxcal_script) {
13 +
executeOxcalScript <- function(oxcal_script, file = NULL) {
11 14
    oxcal_path <- getOxcalExecutablePath()
12 -
    option_file <- tempfile()
15 +
    if (is.null(file)) {
16 +
      option_file <- tempfile()
17 +
    } else {
18 +
      option_dir <- dirname(file)
19 +
      if (!dir.exists(option_dir)) dir.create(option_dir, recursive = TRUE)
20 +
      option_file <- file
21 +
    }
13 22
    output_file <- paste(option_file, ".js", sep = "")
14 23
    cat(oxcal_script, file = option_file)
15 24
    suppressWarnings(system(paste(shQuote(normalizePath(oxcal_path)), option_file)))
Files Coverage
R 66.05%
Project Totals (13 files) 66.05%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading