简体   繁体   中英

R package which imports SparkR (not on CRAN)

This question is related to this : when you are writing a package, how to specify a dependency (either in Imports or Depends ) on an existing R package which is not on CRAN.

I am writing an R package that imports SparkR , which is not in CRAN anymore (it is delivered with Spark in the R folder). I have tried adding the GitHub link to http://github.com/apache/spark/tree/master/R/pkg in the Additional_repositories field of my DESCRIPTION file, with no luck since the R CMD commands (install, check, etc) keep complaining that SparkR could not be found. The same problem has been discussed in this post . In my case, my package is also heavily dependent on SparkR to move it to Suggests .

Could you please suggest an appropriate way to fix this, instead of just assume the SparkR folder already exists in the user's R library folder.

Thanks

What's wrong with assuming your user has SparkR already installed? If they're using Spark, then they already have it (since you said it comes with Spark). If they're not using Spark, then they don't need it (and presumably they don't need your package either). Put a message in your documentation somewhere about installing SparkR, if it bugs you.

If you just want one function from SparkR that is useful outside Spark, then just copy it into your own code (and acknowledge the source). SparkR is Apache licensed , so you're allowed to do this. Or if you don't want to copy, then write your own.

Two options: 1. Give users instructions as to how install this specific package( see help(install.packages) -- it's one line once you know the path) 2. Run your own repo. Package drat helps you run your own repo for instance on github.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM