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
0
votes
1 answer

After I filter my data, the environment shows it same data size

As the problems in this picture show, after I filter data twice, the buyer_dormant and buyer_converted still have same obs as buyer_before_20161222. The console didn't show any errors during the filter process. So I am very confused about what was…
Rachel Y
  • 13
  • 3
0
votes
1 answer

Error: package or namespace load failed for BRugs

I'm a Mac OS user who's trying to run BRugs on Windows (BRugs isn't available for Mac). However I'm unable to install the BRugs package. Example: > library(BRugs) Error : .onLoad failed in loadNamespace() for 'BRugs', details: call: if…
nkscott
  • 1
  • 1
0
votes
1 answer

Add message to package when installed

One of my R packages is going to be deprecated and replaced by a better one, an instead of removing from github I want to add a message/warning that appears when user installed/loaded it, to redirect users to new package Searched somewhere but…
Forge
  • 1,587
  • 1
  • 15
  • 36
0
votes
1 answer

Cannot build package with dot in the name with newer version of Rcpp

since I updated my version of Rcpp to 0.12.11 (I tested it works for 0.12.10) I cannot build my package anymore. Actually creating a new package called dot.test from RStudio cannot be built. Updating dot.test documentation Loading…
statquant
  • 13,672
  • 21
  • 91
  • 162
0
votes
1 answer

Error: missing "PACKAGE" argument in RcppExport.R?

I rebuilt the package I'm developing (and that I haven't been updating since one month) and I found that all my tests fail with the error: Error in myCPlusPlusFun(... : object 'myPackage_myCPlusPlusFun' not found I then found out that the…
ixpl
  • 259
  • 1
  • 8
0
votes
0 answers

#Rcpp# #package# mixed-use of RcppArmadillo and RcppEigen

I am a beginner of Rcpp. I encountered many difficulties in creating an R package(BSMHM2) for the Rcpp function. Before giving the error information, I quickly introduced what I have down as below. I wrote several functions with .cpp file (like…
Kai Kang
  • 1
  • 1
0
votes
1 answer

Writing an R package: automatically set environment variables when the package is loaded

I'm developing an R package, I'd like the behavior of one of my function depends on an Environment Variable ENV_VAR, whose default value is foo, while users can also change this ENV_VAR at runtime using Sys.setenv(ENV_VAR = 'bar'). I tried…
Jia Ru
  • 93
  • 6
0
votes
1 answer

rJava - method with signature not found

My problem is similar to this one : Even with adding the semicolon didn't work for me this is my method when i call .jmethod to display it for me : [10] "public java.util.Set utils.Rinterface.getPhones()" when I call the method, Like this…
0
votes
0 answers

R glarma error: "requires numeric/complex matrix/vector arguments"

This is my data: 'data.frame': 72 obs. of 7 variables: $ X1 : chr "2011M1" "2011M2" "2011M3" "2011M4" ... $ KPR : int 0 0 0 0 0 0 0 0 0 0 ... $ LTV : Factor w/ 3 levels "0","1","2": 1 1 1 1 1 1 1 1 1 1 ... $ sukubunga: num …
delta27
  • 197
  • 1
  • 7
0
votes
1 answer

Error when building/reloading a package in R: "Could not find function "errmsg""

I'm putting together an R package, and made some small edits to the DESCRIPTION file and create a package document. I wanted to view the changes and updated the documentation then hit "Build & Reload" and I'm suddenly getting this error: Error in…
Phil
  • 7,287
  • 3
  • 36
  • 66
0
votes
1 answer

How to create a news function for your own R package

I am creating an R package and now working on the NEWS file. I have an .Rd file in the inst subfolder which I would like to be called by a customised function like my_pckg_news(). I saw this in the gamlss package which has gamlssNews() as the…
joel.wilson
  • 8,243
  • 5
  • 28
  • 48
0
votes
1 answer

R: How to convert graphNEL object into Adjacency Matrix

This is my graphNEL object >mergedPathways_d A graphNEL graph with undirected edges Number of Nodes = 41 Number of Edges = 102 I have tried coerce. It did not work out. It asks to pre-define the matrix and To and From didnot work correctly, I had…
Urvah Shabbir
  • 945
  • 2
  • 15
  • 46
0
votes
1 answer

Failure to compile R Rspectra package on CentOS 7 in a Virtualbox

I'm trying to install the R RSpectra package on a CentOS 7 installation in a VirtualBox but the installation hangs. Here's some system info from the shell and R terminals: [vagrant@localhost ~]$ cat /etc/*-release CentOS Linux release 7.3.1611…
SANBI samples
  • 2,058
  • 2
  • 14
  • 20
0
votes
1 answer

Solve the enclosing parallel error when using OpenMP in R

I try to call OpenMP codes in my R package. The OpenMP region in a fun.c file under the src directory is like: static void mp_func(double *x, double *a, double *b, double *den, int *P) { #pragma omp parallel…
Bs He
  • 717
  • 1
  • 10
  • 22
0
votes
2 answers

How to call a C function in R package

The package has name pareto. This is the .c file in the src directory: #include #include #include "Rinternals.h" #include "R_ext/Rdynload.h" static void dpareto(double *x, double *a, double *b, int *n, int *islog, …
Bs He
  • 717
  • 1
  • 10
  • 22