Where does the data () get the dataset description?

A call datawithout arguments creates a list of available data sets and a brief description of each of them, for example:

!> data()
 Data sets in package ‘datasets’:

 AirPassengers           Monthly Airline Passenger Numbers 1949-1960
 BJsales                 Sales Data with Leading Indicator
 BJsales.lead (BJsales)
                         Sales Data with Leading Indicator
 BOD                     Biochemical Oxygen Demand
 ...

I wrote a package containing some data files in Rda format (made using save()) in a directory data/, and while I data()find them, there is no Description.

!> data()
 Data sets in package ‘datasets’:

 AirPassengers           Monthly Airline Passenger Numbers 1949-1960
 BJsales                 Sales Data with Leading Indicator
 BJsales.lead (BJsales)
                         Sales Data with Leading Indicator
 BOD                     Biochemical Oxygen Demand
 ...

 Data sets in package ‘fbdata’:

 football.d1
 football.e0
 ...

How to include the description of data sets?

+4
source share
1 answer

Use ?promptDataor the appropriate markup roxygen2to generate the file skeleton Rdfor your dataset, then edit it accordingly to add a description, and then rebuild the package ...

@hrbrmaster , , - ( plyr):

datadesc <- file.path(.libPaths()[1],"plyr","Meta","data.rds")
r <- readRDS(datadesc)
r
##      [,1]       [,2]                                                    
## [1,] "baseball" "Yearly batting records for all major league baseball players"
## [2,] "ozone"    "Monthly ozone measurements over Central America."
r[1,2] <- "hacked description"
saveRDS(r,datadesc)

... .

, , , ( , , ?), ...

+2

All Articles