2012-03-05 10 views
19

Estoy tratando de documentar algunos conjuntos de datos en un paquete R utilizando roxygen2. Teniendo en cuenta sólo uno de éstos:documentando el conjunto de datos con roxygen2

  • tengo mypkg/data/CpG.human.GRCh37.RDa
  • que contiene un objeto llamado CpG.human.GRCh37
  • y un archivo llamado: mypkg/R/cpg-data.R, que contiene:

    #' @name CpG.human.GRCh37 
    #' @title CpG islands - human - genome build: GRCh37/hg19 
    #' @description This data set list the genomic locations of human CpG islands, 
    #' with coordinates based on the GRCh37/hg19 genome build. 
    #' @docType data 
    #' @usage CpG.human.GRCh37 
    #' @format a \code{RangedData} instance, 1 row per CpG island. 
    #' @source UCSC Table Browser 
    #' @author Mark Cowley, 2012-03-05 
    #' @export 
    NULL 
    

Cuando roxygenize, esto se crea mypkg/man/CpG.human.GRCh37.Rd, que contiene:

\docType{data} 
    \name{CpG.human.GRCh37} 
    \alias{CpG.human.GRCh37} 
    \title{CpG islands - human - genome build: GRCh37/hg19} 
    \format{a \code{RangedData} instance, 1 row per CpG island.} 
    \source{ 
     UCSC Table Browser 
    } 
    \description{ 
     This data set list the genomic locations of human CpG 
     islands, with coordinates based on the GRCh37/hg19 
     genome build. 
    } 
    \author{ 
     Mark Cowley, 2012-03-05 
    } 
    \usage{CpG.human.GRCh37} 
    \keyword{datasets} 

y export(CpG.human.GRCh37) se agrega el archivo NAMESPACE.

pero cuando R CMD CHECK me sale:

... 
** testing if installed package can be loaded 
Error in namespaceExport(ns, exports) : 
    undefined exports: CpG.human.GRCh37 
Error: loading failed 
... 

ninguna parte he dicho R dónde encontrar este conjunto de datos, aunque yo supongo que el mypkg/data/<name>.RDa sería una buena primera aproximación. Cualquier sugerencia sería increíble.

Si Hadley está mirando, veo que no se crea una sección \ usage y se ignora la directiva @usage.

i estoy usando roxygen-2.2.2, en R 2.13.1

+4

no estoy seguro de que la directiva 'export' @ se utiliza para los datos en sí ts. Intenta eliminar esto. –

+6

no debe exportar el objeto de datos –

+3

gracias chicos. esto requirió 2 correcciones (1) según Writing R extensiones 1.5.1, guarde los objetos como .rda (no .RDa); y (2) elimine @export – drmjc

Respuesta

Cuestiones relacionadas