Questions tagged [cran]

For questions relating to the Comprehensive R Archive Network (CRAN), which serves as a central repository for R distributions and contributed packages. This tag is not for general R questions; use the [r] tag instead.

The Comprehensive R Archive Network (CRAN) is a collection of sites that host distributions, binaries, packages and documentation. There are many CRAN mirrors around the world.

Downloading R

For Linux installation, use your package manager. Instructions for Debian, Redhat, Suse, Ubuntu.

Downloading packages

Documentation

Submitting packages

Bug tracker

R Packages for managing other packages

Related tags

852 questions
15
votes
3 answers

How to update all packages for a new R version quickly and easily?

Suppose I have R version 3.x.x installed, and I upgrade to version 4.x.x, is there any quick/easy way to install all the new versions of the libraries I had installed? Please assume all the packages are on CRAN
stevec
  • 41,291
  • 27
  • 223
  • 311
15
votes
2 answers

Transferring maintainership of an R package on CRAN

I will be taking over the active development and maintaining of an R package on CRAN (of course with approval of the current maintainer). What are the necessary steps to make this happen / Should we proceed as follows?: (I assume only the current…
user3825755
  • 883
  • 2
  • 10
  • 29
15
votes
7 answers

Error ".onLoad failed in loadNamespace() for 'tcltk'"

I have a general question about how to effectively load any kind of external package into R. I have found that many sources detailing this information are simply insufficient, but I will leave out mentioning those respective URLs. I have…
warship
  • 2,924
  • 6
  • 39
  • 65
15
votes
1 answer

closing unused RODBC handle

I have been receiving a Warning Message: `historicalHourly <- importHistoricalHourly(startDatePast,endDatePast,Markets,location) [1] "Importing Hourly Data" [1] "Flag - Moving from importHistoricalHourly to CleaningUpHourly" [1] "Flag - Moving to…
user2480137
  • 171
  • 1
  • 1
  • 4
15
votes
4 answers

Greatest distance between set of longitude/latitude points

I have a set of lng/lat coordinates. What would be an efficient method of calculating the greatest distance between any two points in the set (the "maximum diameter" if you will)? A naive way is to use Haversine formula to calculate the distance…
Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
14
votes
2 answers

List exported objects from R package without attaching it

Is there a way to list the objects that a package exports, without actually attaching it? I tried ls(loadNamespace("ggplot2")) However this shows all of the defined and imported objects in this package. Instead I would like to see only the exported…
Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
14
votes
2 answers

CRAN notes that files cannot be checked without ‘pandoc’ being installed

In doing final checks on a CRAN package submission, this NOTE comes up: * checking top-level files ... NOTE Files ‘README.md’ or ‘NEWS.md’ cannot be checked without ‘pandoc’ being installed. However, pandoc is definitely installed as I use it…
dshkol
  • 1,208
  • 7
  • 23
14
votes
3 answers

CRAN Package Depends on Bioconductor Package Installing error

I manage the Depends, suggests and imports of the description file. and finally I submit my package to CRAN. But during installation the package, it only install the packages which are deposited under CRAN not for bioconductor packages. besides, it…
Mikael
  • 985
  • 1
  • 7
  • 6
14
votes
1 answer

Combining S4 and S3 methods in a single function

What is a good way of defining a general purpose function which should have implementations for both S3 and S4 classes? I have been using something like this: setGeneric("myfun", function(x, ...){ …
Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
13
votes
3 answers

What to do with imperfect-but-useful functions?

I could equally have titled this question, "Is it good enough for CRAN?" I have a collection of functions that I've built up for specific tasks. Some of these are convenience functions: # Returns odds/evens from a vector odds=function(vec) { …
Ari B. Friedman
  • 71,271
  • 35
  • 175
  • 235
13
votes
2 answers

How can I extract the names of all package authors from CRAN

To celebrate the 100,000th question in the r tag, I'd like to create a list of the names of all package authors on CRAN. Initially, I thought I could do this using available.packages() but sadly this doesn't contain a column of the authors. pdb <-…
Andrie
  • 176,377
  • 47
  • 447
  • 496
13
votes
2 answers

testthat pattern for long-running tests

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…
wibeasley
  • 5,000
  • 3
  • 34
  • 62
13
votes
1 answer

Running a pre-build script when building an R package

I have a package that uses both Rcpp and Roxygen2. I'd like to have R CMD build run a small prebuild script that runs compileAttributes() and and roxygenise() before it starting the build process. Is there a hook or mechanism to do this?
James Howard
  • 1,258
  • 2
  • 11
  • 26
13
votes
1 answer

Where to put SQL files in an R package?

I am working on an R package that builds on a postgreSQL database. Hence there are some.sql files that contain a recommended table structure for the corresponding database. I wonder where to put these files if I want to build a package (for CRAN)?
Matt Bannert
  • 27,631
  • 38
  • 141
  • 207
12
votes
2 answers

R keeps asking about "installing from sources that need compilation"

I am trying to install packages (devtools, plyr and several others) and keep getting stuck with the same problem, which seems to appear for some packages more often than others There are binary versions available but the source versions are…
Gmichael
  • 526
  • 1
  • 5
  • 16