Skip to content
Prev 32495 / 398502 Next

help output paged in separate window

Ted Harding wrote:
Well, here is a little function derived from the help browser macro I 
wrote for NEdit that will fire up an xterm with less displaying the help 
for a function. I haven't accounted for operators, but it could be done, 
and I haven't extensively tested it, but I suppose I shouldn't expect to 
have all the fun...

Jim

helpless<-function(topic) {
 topic<-substitute(topic)
 sys.command<-paste("locate ",topic,sep="",collapse="")
 helpfilelist<-system(sys.command,TRUE)
 helpmatch<-paste("help/",topic,sep="",collapse="")
 # find the R text help file(s)
 helpfile<-helpfilelist[grep(helpmatch,helpfilelist)]
 # assume that the shortest name matching "topic" will be the one
 if(length(helpfile) > 1)
  helpfile<-helpfile[which.min(nchar(helpfile))]
 sys.command<-paste("xterm -e less ",helpfile,sep="",collapse="")
 system(sys.command)
}