roxygen

When writing my own R package, I can't seem to get other packages to import correctly

对着背影说爱祢 提交于 2019-11-27 14:24:48
问题 Alright, first attempt at writing an R package and I'm stuck. Here's how I create the package: package.skeleton("pkg",code_files=some.filenames) roxygenize("okg") I'm using roxygen2 and have the following imports in my "pkg-package.R" file: @import data.table zoo lubridate From a terminal, I then run: R CMD build pkg R CMD check pkg R CMD install pkg During the check phase, I get the following warnings: ** preparing package for lazy loading Warning: replacing previous import ‘hour’ when

Using Roxygen2 Template tags

不想你离开。 提交于 2019-11-27 11:14:35
问题 Could someone provide an example of how to properly use the Template Tags in Roxygen2 . I have tried to do the most obvious thing (to me): In my packageName-package.R file: #' [... other Roxygen blocks ...] #' #' @templateVar testTemplateTag Testing one two NULL Then in a file someFunction.R #' [... other Roxygen blocks ...] #' #' @template testTemplateTag I get the error: Error : Can not find template testTemplateTag I am trying to have one place to document commonly repeated definitions

Escaping “@” in Roxygen2 Style Documentation

蓝咒 提交于 2019-11-27 03:47:24
问题 Let's say I have a comment block where I'd like to write an email address. How would I go about escaping the "@" symbol so roxygen treats it as text instead of a directive? 回答1: A double at-sign @@ will do the job. As an example, take the email address in the author field of this documentation: ##' A package to check Roxygen's sanity. ##' @name helloRoxygen-package ##' @docType package ##' @author My name \email{me@@here.org} NA which produces this *.Rd file when processed with roxygenize() :

How can I document data sets with roxygen?

邮差的信 提交于 2019-11-27 03:11:10
Is it possible to include .R files in the data directory of my package in the roxygen process? I have put several .R files in the data directory. When they are sourced with data(), they read in raw data files and perform some transformations. Roxygen can be used anywhere within an R file (in other words, it doesn't have to be followed by a function). It can also be used to document any docType in the R documentation. So you can just document your data in a separate block (something like this): #' This is data to be included in my package #' #' @name data-name #' @docType data #' @author My

Using source subdirectories within R packages with roxygen2

≡放荡痞女 提交于 2019-11-27 02:44:21
问题 I would like to use a directory structure within the R folder for the source code of a package. For example, within my R folder I have an algos folder with functions I want to export and document. However roxygen2 by default does not seem to go through the subfolders of the R folder. I tried to use the @include keyword as follows for a file at `R/algos/algo1.r' #' @include algos/algo1.r but without success. Is there a simple way to use subfolder for the R source code? 回答1: Writing R

How can I document data sets with roxygen?

穿精又带淫゛_ 提交于 2019-11-26 17:59:13
问题 Is it possible to include .R files in the data directory of my package in the roxygen process? I have put several .R files in the data directory. When they are sourced with data(), they read in raw data files and perform some transformations. 回答1: Roxygen can be used anywhere within an R file (in other words, it doesn't have to be followed by a function). It can also be used to document any docType in the R documentation. So you can just document your data in a separate block (something like

Roxygen2 - how to properly document S3 methods

青春壹個敷衍的年華 提交于 2019-11-26 10:26:54
问题 I\'ve read the Roxygen2 PDF as well as this site and I\'m lost about the difference between @method @S3method @export and how you use these to properly document S3 methods. I worked up the follow example for discussion: 1. How would I properly document these? 2. How do I emulate documentation of ?print and other generic functions that show the use cases for all class-specific implimentations (i.e. the way ?print shows usage for \'factor\', \'table\',\'function\') 3. From the wiki page: \"All