Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7441365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:00:06+00:00 2026-05-29T11:00:06+00:00

Possible Duplicate: R help page as object I can do temp <- help(‘ls’) But

  • 0

Possible Duplicate:
R help page as object

I can do

temp <- help('ls')

But I can’t get a handle on this object. I don’t think there’s much meat in it except a call is there? unclass, str, attributes don’t seem to lead anywhere.

I would like to, for example,

(1) Extract the text of the Details section of the help for ls; and

(2) Extract all the text into one big string.

Any ideas? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:00:07+00:00Added an answer on May 29, 2026 at 11:00 am

    help itself doesn’t return anything useful. To get the help text, you can read the contents of the help database for a package, and parse that.

    extract_help <- function(pkg, fn = NULL, to = c("txt", "html", "latex", "ex"))
    {
      to <- match.arg(to)
      rdbfile <- file.path(find.package(pkg), "help", pkg)
      rdb <- tools:::fetchRdDB(rdbfile, key = fn)
      convertor <- switch(to, 
          txt   = tools::Rd2txt, 
          html  = tools::Rd2HTML, 
          latex = tools::Rd2latex, 
          ex    = tools::Rd2ex
      )
      f <- function(x) capture.output(convertor(x))
      if(is.null(fn)) lapply(rdb, f) else f(rdb)
    }
    

    pkg is a character string giving the name of a package
    fn is a character string giving the name of a function within that package. If it is left as NULL, then the help for all the functions in that package gets returned.
    to converts the help file to txt, tml or whatever.

    Example usage:

    #Everything in utils
    extract_help("utils")
    
    #just one function
    extract_help("utils", "browseURL")
    
    #convert to html instead
    extract_help("utils", "browseURL", "html")
    
    #a non-base package 
    extract_help("plyr")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Where can I get to download Java comm api? I'm looking for
Possible Duplicate: self.prop=nil; vs. [prop release];prop=nil; Can anyone help, What is the difference between
Possible Duplicate: maximum length of HTTP GET request? how many characters can be sent
Possible Duplicate: Need help solving Project Euler problem 200 Similar to this question Project
Possible Duplicate: Linq help - Sql trace returns result, but datacontext returning null Question
Possible Duplicate: Get property of object in JavaScript If I have the following: var
Possible Duplicate: jQuery $.get or $.post to catch page load error (eg. 404) Maybe
Possible Duplicate: How to get IMG tag code from HTML document? I need help
Possible Duplicate: SQL Server Database query help Hi, I have a problem that I
Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.