Learn R Programming

sos (version 2.1-8)

print.findFn: print a findFn object

Description

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

Usage

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

Value

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

Arguments

x

An object of class findFn

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', 'Package', 'Function', 'Score', '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

Author

Sundar Dorai-Raj, Spencer Graves, Romain Francois, Uwe Ligges

See Also

Examples

Run this code
splineSearch <- try(findFn("spline", maxPages = 2))

if(!inherits(splineSearch, 'try-error')){
if(!CRAN()){
  print(splineSearch, 'console')
  splineSearch # all columns in a browser
}
webScr <- try(findFn('web scraping'))
if(!inherits(webScr, 'try-error')){
if(!CRAN()){
  print(webScr)
}
}
}

Run the code above in your browser using DataLab