print.packageSum: print a packageSum object

View source: R/print.packageSum.R

print.packageSumR Documentation

print a packageSum object

Description

Print a packageSum object to a file and pass it to a web browser

Usage

## S3 method for class 'packageSum'
print(x, where, title, 
    openBrowser = TRUE, template, ...)

Arguments

x

An object of class packageSum

where

a character vector interpreted as follows:

If length(where)==1, it must be either 'HTML' or 'console' or the name of a column of x or the name of a file to hold the file created to be displayed in a web browser.

If length(where)>1, it must be the names of columns of x to be displayed on the console. If where is a vector of names of columns of x, those columns will be printed to the console, and there will be no display in a web browser. If where == 'console', the following columns of x are displayed: c('Count', 'maxScore', 'totalScore', 'Package', 'Date').

title

An optional title to give the HTML file. Default is to use the original query string.

openBrowser

logical; if TRUE and where is missing or 'HTML', launch default browser after building table

template

Template file used by brew

...

ignored

Value

The full path and name of the file created is returned invisibly.

Author(s)

Spencer Graves

See Also

print.findFn packageSum findFn, RSiteSearch, browseURL brew

Examples

splineHelp <- try(findFn("spline", maxPages = 2))

if(!inherits(splineHelp, 'try-error')){
splinePkgs <- packageSum(splineHelp)
if(!CRAN()){
  print(splinePkgs, 'console')
  splinePkgs # all columns in a browser

  des1 <- try(findFn('differential equations', 1))
  de1 <- try(findFn('differential equation', 1))
# each retrieves 1 page of 20 hits
# but not the same 20

  if(!(inherits(des1, 'try-error') ||
       inherits(de1, 'try-error'))){
  de.s <- unionFindFn(des1, de1)
  de.s
# Other example:  
  webScr <- try(findFn('web scraping'))
  if(!inherits(webScr, 'try-error')){
  pS <- packageSum(webScr)
  print(pS)
}
}
}
}

sos documentation built on May 31, 2023, 7:46 p.m.