-
Notifications
You must be signed in to change notification settings - Fork 20
Read a csv in a vignette? #455
Comments
Good question! My mind immediately jumps to the way datasets are included in packages. When your package is loaded, can you call the dataset directly (the way gapminder can be called after it is loaded)? If so, is it possible to call the dataset that way in the vignette? Otherwise, it may be possible to use These may help: |
You are better off to place such data below Example here: https://github.com/jennybc/repurrrsive You'll see how I make sure of the stuff below This means the example will ship with your package but that sounds reasonable in this case. |
Okay, I've put the files in
When I used
Which, as I understand it, means that the Given that the vignette appears to have been built normally, can I safely ignore this? Semi-Related Question: I tried to use Tools > Project Options > Build Tools > Generate documentation with Roxygen > Configure > Use roxygen to generate vignettes but it doesn't appear to be working - there's no html or md left in |
I'm travelling today so can't do any little experiments to help answer. Re: the Re: second question. It feels like the vignette workflow with devtools and roxygen and RStudio is somewhat in flux. So let this one be a mystery for today. I too would like to know what's optimal, but don't right now. |
Pretty sure. The line references match and the warning disappears when I comment out those lines.
In console:
I also put the relevant code into a test file to see if it produces output. It passes when I run |
Here's an example that might help you troubleshoot, Hadley's > readr_example
function (path)
{
system.file("extdata", path, package = "readr", mustWork = TRUE)
}
<environment: namespace:readr> It could be that a separate function must be created so that it exists in your package's namespace, as |
It is still giving me a warning, it's just now system.file() throwing an error instead of returning a blank string (because of the mustWork argument). |
Can you try restarting R/Rstudio and then installing the package and loading it via |
Restarted R, tried I'm still getting the warning in But all it's doing is preventing the automatic update of the vignette through |
I'd like to read data from a csv to produce an example for my vignette. I created a subdirectory called "data" in my vignette folder and then used
read.csv("data/test.csv")
. This worked while I was knitting a preview in RStudio, but then when I ran check() the check failed withIs there a way to do this, or should I just re-type the csv data into a tibble in my vignette? It's not a very large data set, so it's not impossible to do so, just a bit clunky.
The text was updated successfully, but these errors were encountered: