Romain Francois, Professional R Enthusiast

To content | To menu | To search

Tuesday, September 8 2009

search the graph gallery from R

This is a short code snippet that is motivated by this thread on r-help yesterday. The gallery contains a search engine textbox (top-right) that can be used to search for content in the website using either its internal crude search engine or perform a google search restricted to the gallery.

Here we write a small R function that can be used to take advantage of the search engine, from R <- function( topic, engine = c("Google", "RGG") ){

    engine <- match.arg( engine )
    url <- URLencode( sprintf( "", topic, engine ) )
    browseURL( url )
} "Andrews plot" ) 

Wednesday, August 5 2009

Code Snippet : List of CRAN packages

This is a really simple code snippet that shows how to get the list of CRAN packages and their titles from the html page html page (toulouse mirror in this example).


Note that R has the available.packages function, but it does not give the titles of the packages