R package which imports SparkR (not on CRAN)

匆匆过客 提交于 2019-12-13 05:33:57

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/35971110/r-package-which-imports-sparkr-not-on-cran

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!