79680772

Date: 2025-06-26 15:35:43
Score: 2.5
Natty:
Report link

Nevermind, I found the answer : Load dataset from "R" package using data(), assign it directly to a variable?

Simply add this to global.R :

getdata <- function(...)
{
  e <- new.env()
  name <- data(..., envir = e)[1]
  e[[name]]
}

mydata <- getdata("mydata")

Works perfectly !

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Oeilbrun