r-package

Download jar file into inst/java directory for a R package

落爺英雄遲暮 提交于 2019-12-24 09:25:05
问题 Is it possible to download a JAR into the directory inst/java of a R package on the installation stage? I want to submit a package to CRAN, but the jar is too big and they are not going to accept it. I thought one possible solution would be to automatically download the jar and place it inside inst/java I think H2O do it in its build.gradle. Would it be possible? if so, do I need to use gradle? Update It seems in make-dist.sh they also download the jar. 回答1: This is the key file: https:/

Force one namespace to override / take priority over another without changing load order?

谁说我不能喝 提交于 2019-12-24 03:00:13
问题 select() belongs to both the dplyr and MASS namespaces. Ambiguity about what is called with select() can be solved by either Loading dplyr after loading MASS Using dplyr::select rather than simply select Is there any other solution, preferably one that involves nominating a library to take priority over others? Extra note: I know in the world of CSS, there's an !important attribute that can be added to a style so that it overrides others. I wonder if something similar exists in R which can be

How to remove words from wordcloud R package so that they can be included in the output?

放肆的年华 提交于 2019-12-24 02:16:43
问题 I'm using package "wordcloud" with description "Word Cloud" from the R Packages repository. When I create wordcloud from some random text, some words are omitted automatically as they should not be a part of wordcloud. Code: library(RColorBrewer) library(NLP) library(wordcloud) library(tm) wordcloud("foo bar oh oh by by bye bingo hell no", scale=c(3,1), colors=brewer.pal(6,"Dark2"),random.order=FALSE) Output: I want to keep words like "oh" and "by" in the wordcloud. How? Edit: I prefer doing

Automatically install dependent libraries for a self-made package

流过昼夜 提交于 2019-12-23 20:04:10
问题 I have a question regarding on how to automatically install dependent libraries while installing a self-made package from source. Basically, the DESCRIPTION file looks like: Package: mypackage Type: Package Title: mypackage_title Version: 0.1.0 Author: test Maintainer: test <test @example.com> Description: More about what it does (maybe more than one line) Depends: dplyr, stringr License: MIT LazyData: TRUE RoxygenNote: 5.0.1 I followed the guide and created a .tar.gz file. When I distribute

install R package from private repo owned by github organisation

喜夏-厌秋 提交于 2019-12-23 01:41:59
问题 I am unsure how to install an R package which I have hosted on a private repo owned by an organisation. Previously the repo would have been owned by myself and as an individual user I could use a Personal Access Token and the 'auth_token' argument of devtools::install_github. As far as I am aware this isn't possible for an organisation (github teams). Are there any other solutions that could work? Thanks 回答1: You can try to use install_git instead. To make sure you have the credentials set-up

R package with both .c and .cpp files with Rcpp

五迷三道 提交于 2019-12-22 12:56:05
问题 I'm trying to build an R package which contains both C (in the form of .c files) and C++ code (in the form of .cpp files) using the Rcpp package as a dependency. I have a couple of questions. First, is it actually possible to do this? Can one call C scripts and C++ scripts that are in the same R package? If the previous is possible, how then does one properly register the functions in the C and C++ scripts. To help with this, I have set up a little example which is available on my GitHub page

R package dependencies

核能气质少年 提交于 2019-12-22 03:59:12
问题 i'm trying to build a R package, but it seems that there are some problems with the package dependencies. If I run the code in R, I need the packages "rgdal" and "rgeos", so for creatng the package out of it, I: Added the line "import(rgdal, rgeos)" to the NAMESPACE file Added the line "Depends: rgeos, rgdal" to the DESCRIPTION file When I run R CMD check (after build) I got an error which says: * checking package dependencies ... ERROR Benötigte, aber nicht verfügbare Pakete: 'rgeos' 'rgdal'

When does a package need to use ::: for its own objects

喜夏-厌秋 提交于 2019-12-22 03:17:12
问题 Consider this R package with two functions, one exported and the other internal hello.R #' @export hello <- function() { internalFunctions:::hello_internal() } hello_internal.R hello_internal <- function(x){ print("hello world") } NAMESPACE # Generated by roxygen2 (4.1.1): do not edit by hand export(hello) When this is checked ( devtools::check() ) it returns the NOTE There are ::: calls to the package's namespace in its code. A package almost never needs to use ::: for its own objects:

Which is the correct folder to store images used in vignettes for R packages ?

三世轮回 提交于 2019-12-22 01:26:31
问题 I am writing a vignette for my R package. I want to include a .jpg image on the .Rmd file that will generate the pdf vignette. The question is: where should I store this image? I am using the packages devtools and knitr to generate vignettes (following the advise from @hadley book link). Therefore, I have the folder vignettes in my package structure. Should I just include the file there? Or should I include the image on a new folder inside 'inst/images' , as suggested for external data used

Where to create package environment variables?

痞子三分冷 提交于 2019-12-21 05:23:15
问题 I'm doing a data analysis and created a package to store my vignettes and data, as explained here. I want to set some variables that would be available to all my package functions. These variables define: the path to data sets, the measurements characteristics (such as probes positions), physical constants and so on. I have read that one recommended way to store such variables is to use environments. The question is, where do I put the script that creates the environment? I thought about