[R-SIG-Mac] Spotlight from R

Jan de Leeuw deleeuw at cuddyvalley.org
Fri Apr 7 09:57:18 CEST 2006


This is used as

spotlight("correspondence")

It tells you every file (text or pdf or html) in which the
word "correspondence" occurs in $R_HOME/library. This does not just  
search
titles, keywords, and headings in help files, but all files, and the
entire file, using the Spotlight database. It displays the results in
the pager, which in my case is AquaLess. Of course if you search for  
"and"
or "R" you are in trouble, especially with 1000 packages installed.

spotlight<-function(word) {
place<-paste(Sys.getenv("R_HOME"),"/library/",sep="")
string<-paste("mdfind -onlyin",place,word,"|",getOption("pager"))
system(string, intern=TRUE)
}

==========================================================
Jan de Leeuw, 11667 Steinhoff Rd, Frazier Park, CA 93225, 661-245-1725
.mac: jdeleeuw ++++++  aim: deleeuwjan ++++++ skype: j_deleeuw
homepages: http://www.cuddyvalley.org and http://gifi.stat.ucla.edu
==========================================================
                Many nights on the road
       and not dead yet ---
                the end of autumn.       (Basho 1644-1694)



More information about the R-SIG-Mac mailing list