-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Description
However, data() itself attaches {utils}:
This is as documented, per ?data:
dataensures that the utils package is attached, in case it had been run viautils::data.
Minimal reprex:
tree UtilsDataPkg
# UtilsDataPkg/
# ├── data
# │ └── ut_data.R
# ├── DESCRIPTION
# └── man
# 3 directories, 2 files
# DESCRIPTION:
Package: UtilsDataPkg
Title: UtilsDataPkg
Version: 0.1
RoxygenNote: 7.3.3
Encoding: UTF-8
# data/ut_data.R
myData = read.csv(text = "a,b,c\n1,2,3\n")
Results in:
roxygen2::roxygenize()
# ℹ Loading UtilsDataPkg
# Error in read.csv(text = "a,b,c\n1,2,3\n") :
# could not find function "read.csv"But R CMD INSTALL UtilsDataPackage works, as does loading the data set without {utils}:
$ R CMD INSTALL .
$ R_DEFAULT_PACKAGES=NULL R --vanilla
utils::data(ut_data, package='UtilsDataPkg')
ls()
# [1] "myData"Metadata
Metadata
Assignees
Labels
No labels