Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h1>General info on roxygen and S4 classes</h1> <p>The first version of roxygen had an <code>@slot</code> tag, but that version isn't maintained any more in favor of <code>roxygen2</code>. So it's advised against to use that old version.</p> <p>As for now, <code>roxygen2</code> doesn't have real support for S4 classes. Hadley is working hard to make that happen in <code>roxygen3</code> (<a href="https://github.com/hadley/roxygen3" rel="nofollow">https://github.com/hadley/roxygen3</a>). In case you want to give it a shot and feel brave: install <code>roxygen3</code> from github and try the development version. Note that this version eventually will be incoorporated into <code>roxygen2</code>, so in time the problem will solve itself.</p> <h1>Regarding your workflow:</h1> <p>I personally always find it a bad idea to combine using roxygen and manually written .Rd files. But if you must, you can send the output of roxygen to a different directory using the argument <code>roxygen.dir</code>. This way you can copy whatever you want back into the package directory without overwriting the manually written files.</p> <pre><code>roxygenise("./mypackage", roxygen.dir="./myroxygendir") </code></pre> <p>What I would do, is simply use <code>roxygen2</code> to write the Rd files for your classes as explained in the thread you link to. You don't have to add them manually like you believe for some unknown reason. You just use the <code>#'</code> to indicate the Rd block like always, and use whatever is given in the thread you link to. If you want to make the slots a separate section, you can do that using the <code>@section</code> tag like in the example below.</p> <p>An example of how to add Slots for the moment using <code>roxygen2</code> :</p> <pre><code>#' The MY class #' #' This class blabla yadayada #' #'@section Slots: #' \describe{ #' \item{\code{aslot}:}{Object of class \code{"numeric"}, containing #'whatever and a bit more} #' \item{\code{anotherslot}:}{Object of class \code{"character"}, containing #' strings.} #' } #' #' @note Yes, you can add notes #' @name MY #' @rdname MY #' @aliases MY-class #' @exportClass MY #' @author Joris Meys setClass("MY", representation=representation(aslot="numeric", anotherslot="character" ) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload