cran

Include non-CRAN package in CRAN package

不羁岁月 提交于 2019-12-01 14:18:27
问题 The question is pretty simple. First: Is it possible to include a non-CRAN (or bioconductor, or omega hat) package in a CRAN package and actually use tools from that package in examples. If yes how does one set up the DESCRIPTION file etc. to make it legit and pass CRAN checks? Specifically I'm asking about openNLPmodels.en that used to be a CRAN package. It's pretty useful and want to include functionality from it. I could do a work around and not actual use openNLPmodels.en in the examples

R-3.2.1 unable to load shared object internet.so

只愿长相守 提交于 2019-11-30 23:28:33
问题 I am unable to install packages from CRAN after upgrading R from 3.1.3 to 3.2.1. The error message is that the shared object internet.so cannot be loaded. install.packages("randomForest") Installing package into ‘/gs/project/feb-684-aa/BIF/R/R-3.2.1/library’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- Error in url("http://cran.r-project.org/CRAN_mirrors.csv") : internet routines cannot be loaded In addition: Warning message: In url("http://cran.r

testthat pattern for long-running tests

时光毁灭记忆、已成空白 提交于 2019-11-30 17:55:21
I have a bunch of tests that I don't want them running during CRAN checks or Travis CI builds. They are either long-running, or they could cause transaction/concurrency conflicts writing to a networked database. What approach of separating them (from the R CMD check tests) works best with testthat ? Should I put those tests in a separate folder? Should I tag their filename and use a regex? (eg Using filter argument in test_package to skip tests by @Jeroen) http://cran.r-project.org/web/packages/policies.html : Long-running tests and vignette code can be made optional for checking, but do

testthat pattern for long-running tests

江枫思渺然 提交于 2019-11-30 16:47:17
问题 I have a bunch of tests that I don't want them running during CRAN checks or Travis CI builds. They are either long-running, or they could cause transaction/concurrency conflicts writing to a networked database. What approach of separating them (from the R CMD check tests) works best with testthat? Should I put those tests in a separate folder? Should I tag their filename and use a regex? (eg Using filter argument in test_package to skip tests by @Jeroen) http://cran.r-project.org/web

R, passing variables to a system command

孤街醉人 提交于 2019-11-30 15:02:21
Using R, I am looking to create a QR code and embed it into an Excel spreadsheet (hundreds of codes and spreadsheets). The obvious way seems to be to create a QR code using the command line, and use the "system" command in R. Does anyone know how to pass R variables through the "system" command? Google is not too helpful as "system" is a bit generic, ?system does not contain any examples of this. Note - I am actually using data matrices rather than QR codes, but using the term "data matrix" in an R question will lead to havoc, so let's talk QR codes instead. :-) system("dmtxwrite my_r_variable

How do we plot images at given coordinates in R?

我们两清 提交于 2019-11-30 10:33:22
Given 'n' images in a png/jpeg format and 'n' corresponding coordinates in 2 dimensions (x,y): I would like to plot these images at the given coordinates on a single plot. If I find the images to be too big, I would ideally like to plot them as a smaller/scaled version at the given coordinates. How can i achieve such a plot in R? An example of how such a plot would look is given below: xy <- data.frame(x=runif(10, 0, 100), y=runif(10, 0, 100)) require(png) img <- readPNG(system.file("img", "Rlogo.png", package="png")) thumbnails <- function(x, y, images, width = 0.1*diff(range(x)), height = 0

Change tempdir() in session (update R_TempDir)

杀马特。学长 韩版系。学妹 提交于 2019-11-30 10:19:01
I am looking for a way to change the tempdir() location after an R session has started. I think it would be required to update the C level global variable R_TempDir . What would be a nice way to do this from within R? If you unlock tempdir() and re-assign a new function to the baseenv() it might work: tempdir <- function() "/NewTempDir" unlockBinding("tempdir", baseenv()) assignInNamespace("tempdir", tempdir, ns="base", envir=baseenv()) assign("tempdir", tempdir, baseenv()) lockBinding("tempdir", baseenv()) Update: Simon Urbanecks unixtools package has a function to accomplish this. Below the

Disable/suppress tcltk popup for CRAN mirror selection in R

佐手、 提交于 2019-11-29 21:25:03
My question is similar to a question previously posted but never really answered here: Disable GUI, graphics devices in R I do not like the R tcltk popups for CRAN mirror selection. They also pop up to choose a package when searching for help on a function in two packages. Is there any way to disable these windows without disabling X11 completely? I still want plot() commands to work as normal, but disable the little select menus that take forever to load over a remote connection. For example, if you use ssh, but don't use -X, then the mirror select is just text within R, you type a number. It

How do we plot images at given coordinates in R?

久未见 提交于 2019-11-29 15:45:38
问题 Given 'n' images in a png/jpeg format and 'n' corresponding coordinates in 2 dimensions (x,y): I would like to plot these images at the given coordinates on a single plot. If I find the images to be too big, I would ideally like to plot them as a smaller/scaled version at the given coordinates. How can i achieve such a plot in R? An example of how such a plot would look is given below: 回答1: xy <- data.frame(x=runif(10, 0, 100), y=runif(10, 0, 100)) require(png) img <- readPNG(system.file("img

Change tempdir() in session (update R_TempDir)

守給你的承諾、 提交于 2019-11-29 15:22:22
问题 I am looking for a way to change the tempdir() location after an R session has started. I think it would be required to update the C level global variable R_TempDir . What would be a nice way to do this from within R? 回答1: Update: Simon Urbanecks unixtools package has a function to accomplish this. Below the code (for future reference). set.tempdir <- function(path) { invisible(.Call(C_setTempDir, path.expand(path))) } C code: #include <string.h> #include <Rinternals.h> #include <Rembedded.h>