from - r roxygen2 example
documentando el conjunto de datos con roxygen2 (1)
Estoy tratando de documentar algunos conjuntos de datos en un paquete R usando roxygen2. Considerando solo uno de estos:
- 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 obtengo:
...
** testing if installed package can be loaded
Error in namespaceExport(ns, exports) :
undefined exports: CpG.human.GRCh37
Error: loading failed
...
En ningún lugar le he dicho a R dónde encontrar este conjunto de datos, aunque supongo que mypkg/data/<name>.RDa sería una buena primera suposición. Cualquier consejo sería increíble.
Si Hadley está mirando, me doy cuenta de que no se crea una sección / use y se ignora la directiva @usage.
Estoy usando roxygen-2.2.2, en R 2.13.1
Esto requirió 2 arreglos:
- Como se explica en Escribir extensiones R 1.1.5, Datos en paquetes , guarde los objetos como
.rdalugar de.RDa - eliminar
@exportde la Roxygen