- 
                Notifications
    You must be signed in to change notification settings 
- Fork 237
Open
Description
I think this is resurfacing #442.
I have a simple package:
.
├── data
│   └── mtcarsPkg.csv
├── DESCRIPTION
├── man
├── NAMESPACE
└── R
    └── data.R
4 directories, 4 files
# DESCRIPTION
Title: dataPkg
Package: dataPkg
Version: 0.1
RoxygenNote: 7.3.3
Encoding: UTF-8
# NAMESPACE is _empty_
# data/mtcarsPkg.csv is just write.csv(mtcars, "data/mtcarsPkg.csv")
# R/data.R
#' mtcars
"mtcarsPkg"
roxygenize() fails:
Error: 'mtcarsPkg' is not an exported object from 'namespace:dataPkg'
But R CMD INSTALL . works fine and the data is available:
R CMD INSTALL . && Rscript -e 'data("mtcarsPkg", package="dataPkg")' # (no error)
Based on #442 (comment), we might guess we just need to add LazyData: true, but that doesn't change anything.
We can fix it by using .rda instead, but some authors prefer using plaintext data and it's supported per WRE:
mtcarsPkg = mtcars
save(mtcarsPkg, file='data/mtcarsPkg.rda')
roxygenize() # worksAt a minimum, we should document that only .rda is supported by roxygen2 in vignette("rd-other").
We can also "fix" this by doing mtcarsPkg <- NULL in R/data.R, and export(mtcarsPkg) in NAMESPACE, but that also confuses roxygenize():
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{mtcarsPkg}
\alias{mtcarsPkg}
\title{mtcars}
\format{
An object of class \code{NULL} of length 0.
}
\usage{
mtcarsPkg
}
\description{
mtcars
}
\keyword{datasets}
Metadata
Metadata
Assignees
Labels
No labels