Don't write to User Directories per CRAN
Closed this issue · 6 comments
Please ensure that your functions do not write by default or in your examples/vignettes/tests in the user's home filespace (including the package directory and getwd()). This is not allowed by CRAN policies. Please omit any default path in writing functions. In your examples/vignettes/tests you can write to tempdir().
It is related to that but also to the fastf1 cache, which I'm not sure how to change got memory/tempdir
I think we may have to set the cache dir option initiated as NA
. Then have a check before each fastf1 function call, that if the cache dir option is NA
it fails, with instructions on how to select a dir? We can also provide a convenience function set_cache_dir()
that takes a path as an arguement and defaults to getwd()
.
I think that is a sound solution but I worry it makes the user experience/setup too many steps. Maybe using tempdir()
as the default works?
That's a good idea.
We can default to tempdir() but message the user once per session that it's better to set an option for a permanent cache. We can also default memoise to use a RAM cache and httr2 to not cache unless the user sets other options. Maybe a vignette on caching is due too 😳. I can start them this afternoon.
Yes, I like that. I can start on the tempdir()
and message part shortly as well. The vignette is a good idea