swh:1:snp:a4c99a50dc49f82b591f268001b320f8c3ca0041
Raw File
Tip revision: e3fb24ebd97f7686caee78bcef4e558b908a465e authored by jmc on 01 December 2007, 00:00:00 UTC
version 0.97-1
Tip revision: e3fb24e
chunks.R
## R functions to interface to Perl routines
## The Perl code routines have been defined when SoDA was loaded

chunksAdd <- function( table = .PerlExpr("\\%{0};", .convert = FALSE),
                      data = character(),
                      convert = length(data) == 0) {
    if(!inherits(table, "PerlHashReference"))
      stop(gettextf(
       "Argument table must be reference to a Perl hash object; got an object of class \"%s\"",
                    class(table)), domain = NA)
    args <- c(list(table), as.list(data))
   .Perl("chunks_add",  .args = args, convert = convert)
}

chunksDrop <- function(table,
                       data = character(),
                       convert = length(data) == 0) {
    if(missing(table))
      stop("Must start with a non-empty table")
    else if(!inherits(table, "PerlHashReference"))
      stop(gettextf(
       "Argument table must be reference to a Perl hash object; got an object of class \"%s\"",
                    class(table)), domain = NA)
    args <- c(list(table), as.list(data))
   .Perl("chunks_drop",  .args = args, convert = convert)
}
back to top