0

I have an external dataset in /data folder as I am developing a R package. I call it data_m. devtools::check() shows now errors of the dataset.

As I run the vignette with Knit, however, I could not see the results of any functions, such as colnames(data_m) or the functions that I wrote.

For instance

```r colnames(data_m) ```

only gives me the code colnames(data_m) instead of the column names of the dataset.

Also,

```{r} colnames(data_m) ```

generates the error Error in this data.frame(x): objectdata_mnot found Calls: <Anonymous> ...withVisible -> eval -> eval -> colnames -> is.data.frame Execution halted

As I run

devtools::check()

I also shows

frequencyrank: no visible binding for global variable ‘data_m’

I think there is a disconnection between the dataset and the vignette. But I am not sure what it is.

Could anyone let me know what the problem actually is? Thank you very much.

yearntolearn
  • 1,064
  • 2
  • 17
  • 36
  • Could section *Embed code with knitr syntax* in RMarkdown cheat sheet help? https://www.rstudio.com/wp-content/uploads/2016/03/rmarkdown-cheatsheet-2.0.pdf – jay.sf Nov 05 '17 at 10:49
  • Restart your R session, then run the code section by section on the command line. See if you get the same error. Presumably `data_m` is missing. –  Nov 05 '17 at 11:03
  • Thank you. I think the most important problem would be the dataset is not visually binding in a global environment. I am seeking solution to this. – yearntolearn Nov 05 '17 at 13:02

0 Answers0