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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With