Jyoti Sharma
Jyoti Sharma

Reputation: 17

creating package

i am creating a package in R language, everything is running properly, but when i run R CMD check , it shows an error message while running examples.. i.e. "can't open the file." "No such file or directory" actually my function needs a PubMed text file containing abstracts from the PubMed, i have placed my text file in every sub-directory of my package, but its not working. showing same error again and again. so please suggest me the right way how to put a text file in a package which can be used by examples to run properly. i will be very thankful to you.

Upvotes: 1

Views: 144

Answers (2)

Oldyoung
Oldyoung

Reputation: 597

I suggest you to use devtools and roxygen2 packages. Basically, you just need to prepare description and .R files.

see more details in this brilliant answer :devtools roxygen package creation and rd documentation

Upvotes: 0

Beasterfield
Beasterfield

Reputation: 7113

Usually you put such data in the /inst folder. E.g.:

<packageRoot>/inst/pubmed/myfile

After the package is build you can access the content of this folder from within the package like this:

system.file( "pubmed/myfile", package="<package>" )

See for more information http://cran.r-project.org/doc/manuals/r-release/R-exts.pdf (1.1.5 Data in packages).

Upvotes: 1

Related Questions