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
2 answers

Maintain data in R package with scheduled sql pulls

I have a personal, non-CRAN, R package. Its purpose is reduce the amount of repeated wrangling I need to do. The data must be pulled from sql server. This pull from SQL is done weekly. Where should I put my sql file and where should I put the R code…
Alex
  • 2,603
  • 4
  • 40
  • 73
0
votes
0 answers

R package that delivers executables residing in /inst

I would like to create an R package that relies on executables that I put into the /inst folder. However, whatever I put in /inst loses the execution bit after the package is installed, hence the binaries become non-executable due to the missing…
axiom
  • 406
  • 1
  • 4
  • 16
0
votes
0 answers

Releasing an R package with several large text fles

I'm currently creating an R package, and my scripts require before any analysis is done that 3-4 text files be loaded. Normally, I would run the scripts with the following: library(data.table) session_data =…
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
0
votes
1 answer

mapply vs loop in R package

I've written a simple function that converts old Japanese text to modern form. I want to post as a package, but I'm trying to improve it in two ways. First, there is a small speed gain using mapply rather than a loop, but I can't get the results I…
Mark R
  • 775
  • 1
  • 8
  • 23
0
votes
1 answer

Adding and accessing package files to a new R package

I created a new project as a "R package" in RStudio v. 1.0.1.153. By default such a new R package project comes with file hello.R containing a template function hello <- function() { print("Hello, world!") } which can be accessed simply by…
Heikki
  • 2,214
  • 19
  • 34
0
votes
0 answers

Why does R crash when adding DESeq2 as dependency to R package?

I'm writing an R package using devtools and roxygen2. Note that this is my first time making a package, so maybe I am missing something important. I want to add a dependency, the package, DESeq2. I have tried to do this in a number of ways, but…
Adam Price
  • 810
  • 2
  • 11
  • 21
0
votes
1 answer

Import doesn't import in r package development

I am trying to create a package. I use the ggplot2 library for one of the functions. I have written the import statement for the function: #' @param x the dataframe #' @param Column the dataframe #' @param Code the dataframe #' @keywords Appointment…
Sebastian Zeki
  • 6,690
  • 11
  • 60
  • 125
0
votes
0 answers

R - Error in odbcDriverConnect("") : object 'C_RODBCDriverConnect' not found

I'm trying to connect to SQL Server from R Studio. I've installed RODBC package. But when I try to create a dobcDriveConnect() handle, I get this error: Error in odbcDriverConnect("") : object 'C_RODBCDriverConnect' not found Does anyone know…
jmich738
  • 1,565
  • 3
  • 24
  • 41
0
votes
1 answer

BDgraph R package producing different (but consistent) results on different OSs

I'm producing samples from a G-Wishart distribution (for example Mohammadi and Wit (2015) and Mohammadi et al. (2017) ) using the BDgraph package in R, but I'm getting different results from one OS to another. The results are however consistent on…
FooBant
  • 394
  • 1
  • 14
0
votes
0 answers

How can I get R to replace the text for an author's role, which is showing as '[NA]'?

This question is an offshoot of another question from yesterday. I'm currently writing my first R package, following Hadley Wickham's excellent book on the topic. The section of the book linked above includes examples for adding authors and…
J L
  • 400
  • 3
  • 15
0
votes
1 answer

unexpected input in "%load_ext rpy2.ipython" in R - ipython

I am new to R and trying to execute the code in this site but unfortunately, I am experiencing this error "Error: unexpected input in "%load_ext rpy2.ipython"" when entering "%load_ext rpy2.ipython" in the R console and I tried searching google for…
jtocs
  • 1
  • 2
0
votes
0 answers

Procedure Entry Point Error

I'm trying to download a package but keep getting this error. Anyone have experience with it? install.packages(c("devtools","rstudioapi"), dependencies=TRUE, repos=c("http://rstudio.org/_packages",…
wizkids121
  • 634
  • 1
  • 9
  • 22
0
votes
0 answers

dealing with large dataset when creating R package

I am trying to create an R package. I have a prebuilt r data object(model.RData) saved in data folder of my R package . But its size is huge ~30 GB. While installing the package I got the below error: Error in utils::tar(filepath, pkgname,…
Vishnu
  • 110
  • 2
  • 10
0
votes
0 answers

R sf package order of library loading matters when using Rscript

It appears that the order of loading packages matters when using Rscript with the sf library. library(sf) library(methods) showMethods("coerce") will not contain from="sf", to="Spatial" from="Spatial", to="sf" in the output, and the function…
user2711915
  • 2,704
  • 1
  • 18
  • 17
0
votes
0 answers

Some Packages not Running on R Version 1.0.153

I have recently upgraded to the latest version of R Studio Version 1.0.153. However in the previous version the packages processmapR and DiagrammeR were getting installed easily but now the after installing and loading the package, this is the error…
AK94
  • 325
  • 1
  • 5
  • 11