简体   繁体   中英

R calling a dataset in the package itself

I have created a package containing a dataset called mydata .

I want to use my dataset in my functions but I dont know how to call it. when i use data("mydata") to call my dataset and avoid warning messages I have another message during the building process

See section 'Good practice' in '?data'.

@imporFrom mypackage mydata doesn't work either. What's the best way to call a dataset in the package itself?

Use package_name::mydata , example in car package car::Angell .

Dataset is in a data folder with for example mydata.rda inside.

To add help, create a data.R file in R folder.

Personnaly I put inside:

# 1. mydata ----

#' Here is a long title
#'
#' Description of the dataset : length, columns
#'
#' @format one object of class XXX
#'
#' @source where it comes from
#' @name mydata
NULL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM