[R-pkg-devel] Run Examples Not Found
Mat Fok
qu|k@||ver67213 @end|ng |rom y@hoo@com
Wed May 7 22:10:50 CEST 2025
Hi,
My example sources data from olr/inst/extdata and I point to it in my example. I do not include the `dontrun{}` function around this @examples as I want to be able to click "Run Examples" in my Help documentation but I get the error /Example/olr not found. I was thinking maybe I should have a folder called Example, but ChatGPT said no. I have searched online for this but the most relevant thing I have found was stackoverflow.com/questions/76365640/r-roxygen-examples-example-foo-bar-not-found, but no one answered and it is over a year old.
|
|
|
| | |
|
|
|
| |
R Roxygen @examples /Example/foo_bar not found
I am creating an R package and can't run the examples when using devtools::load_all()I always get /Example/func...
|
|
|
Here is my example:
#' @examples#' # Option 1: Manual loading from package (if preferred)#' # file <- system.file("extdata", "crudeoildata.csv", package = "olr", mustWork = TRUE)#' # crudeoildata <- read.csv(file, header = TRUE)#' # dataset <- crudeoildata[, -1]#'#' # Option 2: Preferred - using load_custom_data()#' dataset <- load_custom_data("crudeoildata.csv", exclude_first_column = TRUE)#'#' responseName <- "CrudeOil"#' predictorNames <- c("RigCount", "API", "FieldProduction", "RefinerNetInput",#' "OperableCapacity", "Imports", "StocksExcludingSPR", "NonCommercialLong",#' "NonCommercialShort", "CommercialLong", "CommercialShort", "OpenInterest")#'#' olr(dataset, responseName, predictorNames, adjr2 = FALSE)
Here is my file structure:
olr/├── DESCRIPTION├── NAMESPACE├── .Rhistory├── R/│ ├── olr_function.R│ └── utils.R├── man/│ ├── olr.Rd│ └── load_custom_data.Rd└── inst/ └── extdata/ └── crudeoildata.csv
How do I Run Examples properly?
Thanks,
Mathew Fok
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list