pcts-package

pd <- packageDescription("pcts") lb <- library(help="pcts", character.only=TRUE) lbinfo <- if(!is.null(lbinfo[[2]]))lbinfo[[2]])) lbinfo[[2]] else "No_matches" anypat <- function(string, pat, ...){ any(sapply(pat, function(x)grepl(x, string, ...))) } lbsubset <- function(lbinfo, pat){ if(length(lbinfo) == 0) return("Noentries") ind.start <- which(sapply(lbinfo, function(x) anypat(x,pat))) if(length(ind.start) == 0) return("No entries") ind.ws <-which(grepl("^[[:space:]]+", lbinfo)) res <- ind.start for(ind inind.start){ while(any((ind+1) - ind.ws == 0)){ ind <- ind + 1 res <-c(res, ind) } } lbinfo[ sort(res) ] } lbpaste <- function(pat) paste("\preformatted{", {wrk <-lbsubset(lbinfo,pat); wrk <- gsub("(^[^\]?%)|(([^\])%)",paste0("\3", "\\", "%"), wrk); paste(if(length(wrk) > 0) wrk else"No entries", collapse="\n")}, "}", sep="") pd$Title

  • Maintainer: Georgi N. Boshnakov
  • License: GPL (>= 2)
  • Last published: 2025-03-17