https://github.com/cran/SoDA
Revision abb11e53fd1d4cd6d80e90fa5a000adda65fe209 authored by jmc on 14 July 2008, 00:00:00 UTC, committed by Gabor Csardi on 14 July 2008, 00:00:00 UTC
1 parent 9e5b9bb
Raw File
Tip revision: abb11e53fd1d4cd6d80e90fa5a000adda65fe209 authored by jmc on 14 July 2008, 00:00:00 UTC
version 1.0-3
Tip revision: abb11e5
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