Questions tagged [r-package]

This tag should be used for questions regarding the development of R packages. Do not use this tag to ask questions about the use of R packages. Many common R packages have their own tags for that purpose.

This tag should be used for questions regarding the development of R packages. Do not use this tag to ask questions about the use of R packages. Many common R packages have their own tags for that purpose.

The R Core Team defines a package in the Manual on Writing R Extensions:

A package is a directory of files which extend R, a source package (the master files of a package), or a tarball containing the files of a source package, or an installed package, the result of running R CMD INSTALL on a source package. On some platforms (notably OS X and Windows) there are also binary packages, a zip file or tarball containing the files of an installed package which can be unpacked rather than installing from sources.

1279 questions
-1
votes
2 answers

Loading a R package's function from Rcpp function in a new package namespace

I am developing a package for R and would like to load the functionalities of an R package inside an Rcpp function. I know about Rcpp::Environment env("package:package_of_interest"), but this only works when the "package_of_interest" is loaded from…
G4lActus
  • 64
  • 7
-1
votes
2 answers

Can we use funtions from testthat package to test elements of a vector?

I've created a package that has a function, in this case is myfunction(argument1, argument2), that requires only positive inputs that have the same length as arguments. And I want to test whether the input is in a correct format using functions from…
-1
votes
1 answer

"function %>% not found" - dplyr-package is loaded

I am currently trying to get my r-application running via shinyproxy in combination with docker - unfortunately without success. The app works without problems when started via R-Studio. However, as soon as I create the Docker image and try to call…
LePyka
  • 181
  • 8
-1
votes
1 answer

R package development check, build, and install runtime is very slow (due to GitHub?)

there. I am creating a Stan-based R package. I know that the devtools::check(args = c('--as-cran')) runtime (which involves compiling the C++ codes) is slow. In my case, it takes about 20 minutes. Fortunately, the devtools::check_win_release() and…
-1
votes
1 answer

R roxygen2: Do not show function in list

This question is about using roxygen2 and not about how to override a function. I am using roxygen2 for a CRAN package and I am trying to achieve the following: There is a function called my.function whose function name I want to replace with…
Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55
-1
votes
1 answer

R package: sourcing scripts from folder on package load

My idea is simple, I have a wrapper package that is ready to load and execute R and Python scripts (through reticulate). Despite the requirement for a common file/code structure, the idea is that if a user wants to define a new method for the…
runr
  • 1,142
  • 1
  • 9
  • 25
-1
votes
1 answer

R package 'gfortran' is not available (for R version 3.3.1)

I'm trying to install the package 'gfortran' (because the package 'deSolve' demands it to be insatlled) but get the error: install.packages("gfortran") Warning in install.packages : package 'gfortran' is not available (for R version 3.3.1) How…
Cranjis
  • 1,590
  • 8
  • 31
  • 64
-1
votes
1 answer

why I cannot download R packages using work computer

I just tried to download the R packages for my working computer but I run into issues when using install.packages(): install.packages("dplyr") unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.5: cannot open URL…
DJJKZ
  • 175
  • 12
-1
votes
1 answer

romove rows with some specific value in columns

I like to remove rows contain chr1_ _random and then sort my data based on chr and start columns: data: Coordinates chr start end …
star
  • 743
  • 1
  • 7
  • 19
-1
votes
1 answer

offline installation of packages in R - empty index file generated

I am trying to install packages on a remote windows machine with no internet connection using source packages. I am trying to follow the instructions given in an answer to the previous question Offline install of R package and dependencies I have a…
Satya
  • 1,708
  • 1
  • 15
  • 39
-1
votes
1 answer

Rtools can't be installed on windows under devel version of R?

I am trying to build an R package using RStudio on Windows 8.1. When I attempt to build the package via RStudio's Build panel I receive: WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the…
Hamilton
  • 620
  • 2
  • 14
  • 32
-1
votes
2 answers

Error while importing mice functions in R package

I would like to include the mice::mice function in my package to perform imputation on my data. I use Roxygen to list imports #' @param data dataset to be used for imputation #' @importFrom dplyr select_ #' @importFrom mice mice complete #' @return…
mickkk
  • 1,172
  • 2
  • 17
  • 38
-1
votes
1 answer

Create R package that run only in batch mode

I need to distribute my code as R package in order to publish a paper. The script is supposed to run in batch mode with keyword argument e.g. Rscript script.R --input=foo.txt --barparameter=bar --outputname=output.txt It's pretty well written…
Victor
  • 13
  • 1
-1
votes
1 answer

Using roxygen2 for R functions in an R package containing R/Cpp code

I have a Cpp function that is called inside an R function using Rcpp packgae. The R function accepts an inputDataFrame and uses the Cpp function (also accepts a DataFrame) to calculate drug amounts (A1) as a function of time. R then returns the…
Amer
  • 2,131
  • 3
  • 23
  • 38
-1
votes
1 answer

R package with Fortran module on Windows? undefined reference to `__stack_chk_fail'

I created a R library that uses a Fortran module. Everything works like a charm on linux. Now I'm trying to make it work on Windows. I cloned my git repository on a windows computer, and when I press the build and reload button on Rstudio I get…
Ignacio
  • 7,646
  • 16
  • 60
  • 113
1 2 3
85
86