Skip to content
Prev 2548 / 15076 Next

Spotlight from R

On Fri, 7 Apr 2006, Jan de Leeuw wrote:

            
Cool! You could augment that by adding your personal
library(*) to the mix as:

spotlight <- function(word) {
    system(sprintf("mdfind -onlyin %s -onlyin %s %s | %s",
                   file.path(R.home(),
                             "library"),
                   file.path(path.expand("~"),
                             "Library",
                             "R",
                             "library"),
                   word,
                   getOption("pager")),
           intern = TRUE)
}


*) mdfind doesn't take a directory path (as one might
expect) and repeating the 'onlyin' argument augments
the search location rather than overrides. What a unique
implementation...

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)