SCM

SCM Repository

[tm] Diff of /pkg/R/utils.R
ViewVC logotype

Diff of /pkg/R/utils.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1444, Mon Aug 22 11:50:13 2016 UTC revision 1445, Sun Oct 9 09:30:58 2016 UTC
# Line 7  Line 7 
7      invisible(x)      invisible(x)
8  }  }
9    
10  .xml_value_if_not_null <- function(n, default) if (!is.null(n)) XML::xmlValue(n) else default  ## Efficient alternative to table() proposed by Kurt Hornik
11    .table <- function(x) {
12        u <- sort(unique(x))
13        v <- tabulate(match(x, u))
14        names(v) <- u
15        v
16    }
17    
18    .xml_value_if_not_null <-
19    function(n, default) if (!is.null(n)) XML::xmlValue(n) else default
20    
21  .xml_content <- function(doc, spec) {  .xml_content <- function(doc, spec) {
22      type <- spec[[1]]      type <- spec[[1]]
# Line 49  Line 58 
58  map_IETF_Snowball <-  map_IETF_Snowball <-
59  local({  local({
60      codes <- unlist(IETF_Snowball_map, use.names = FALSE)      codes <- unlist(IETF_Snowball_map, use.names = FALSE)
61      names <- rep.int(names(IETF_Snowball_map),      names <- rep.int(names(IETF_Snowball_map), lengths(IETF_Snowball_map))
                      sapply(IETF_Snowball_map, length))  
62    
63      function(code) {      function(code) {
64          code <- as.character(code)          code <- as.character(code)

Legend:
Removed from v.1444  
changed lines
  Added in v.1445

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge