Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • error with htmlcb package

    Hi all,

    I am trying to run a do file that uses htmlcb.

    The line of code I am using is:

    htmlcb, saving(codebook.html) replace

    and the error code I encounter is:

    option fn() required
    r(198);

    I am unsure what is missing here, I downloaded the htmlcb package after being prompted to do so, and now I have an empty HTML file after saving.

  • #2
    htmlcb is a command that creates a codebook from a dataset. In order to do that, it needs to know the dataset from which to create the codebook. If there is data in memory, then it will take that data. If no data is in memory, then you need to tell it what dataset to use with the files() option (the error message is indeed confusing). If you don't do that, then htmlcb does not know what dataset to use, and returns that error message. So there are two ways to solve it:
    1. Open the dataset you want to use first and than type htmlcb, saving(codebook.html) replace
    2. Assuming the file is called data.dta you type htmlcb, saving(codebook.html) replace files(data.dta)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Hi Maarten,

      The dataset is already open. I appended two data sets, and after cleaning, I want to run the htmlcb, saving(codebook.html) replace command. I do not want to replace the appended file with the codebook, however. Let me know your thoughts.

      Comment


      • #4
        That should not happen. Maybe you are using frames, and the frame that is open when you execute htmlcb is empty? I cannot think of another reason why this might happen.
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Hi, I had the same problem today where I imported a dataset from SPSS, added some notes etc and then wanted to run htmlcb... same issue. Turns out that all it takes is actually saving the dataset first. So Maarten, "If there is data in memory, then it will take that data" apparently does not apply, of I'm mistaking what is actually meant by "in memory". Perhaps it's a problem with htmlcb's programming, I'm not sure, but anyway just save your dataset before running htmlcb and you're golden!

          Comment

          Working...
          X