cran

R CRAN package installation failing

不问归期 提交于 2019-12-13 03:57:21
问题 I have recently upgraded the institute workstations to Debian 10. Since the R version got bumped to 3.5.2 (from 3.3) I have removed my ~/R directory and was just going to install the new packages. This is the R version that I have: R version 3.5.2 (2018-12-20) -- "Eggshell Igloo" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) Doing install.packages('jsonlite') got me asked whether I want to create a new user library and the installation

list all functions on CRAN

牧云@^-^@ 提交于 2019-12-12 14:12:01
问题 Suppose I'm trying to run a script of unknown origin, and one of the functions is from a package that is not loaded by the script (an oversight, maybe it was loaded in the .Rprofile of the person who wrote it). How can I find in which package this function resides? There's some information compiled on CRAN, that doesn't require the user to download/install all R packages locally; however as far as I could tell it only gives access to the DESCRIPTION files. RSiteSearch, and its web equivalent,

Density of a Two-Piece Normal (or Split Normal) Distribution

流过昼夜 提交于 2019-12-12 12:14:06
问题 Is there a density function for the two-piece Normal distribution: on CRAN? Thought I would check before I code one. I have checked the distribution task view. It is not listed there. I have looked in a couple of likely packages, but to no avail. Update: I have added dsplitnorm , psplitnorm , qsplitnorm and rsplitnorm functions to the fanplot package. 回答1: If you choose to construct your own version of the distribution, you might be interested in distr . It (and the related packages distrEx ,

Using filter argument in test_package to skip tests

為{幸葍}努か 提交于 2019-12-12 11:57:55
问题 I would like to run my package unit tests during R CMD check , but skip tests that require an internet connection. By convention, all unit tests that require internet have the word network in their filename. Hence my run-all.R contains: library(testthat) test_package("mypackage", filter="^((?!network).)*$") However this gives an invalid regular expression error. How do I specify the filter argument such that it runs each unit test except the ones with the word network in them? 回答1: Use the

available.packages by publication date

点点圈 提交于 2019-12-12 08:12:31
问题 Is it possible to get the publication date of CRAN packages from within R? I would like to get a list of the k most recently published CRAN packages, or alternatively all packages published after date dd-mm-yy. Similar to the information on the available_packages_by_date.html? The available.packages() command has a "fields" argument, but this only extracts fields from the DESCRIPTION. The date field on the package description is not always up-to-date. I can get it with a smart regex from the

What to do with imperfect-but-useful functions?

冷暖自知 提交于 2019-12-12 07:45:11
问题 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) { stopifnot(class(vec)=="integer") ret = vec[fpart(vec/2)!=0] ret } evens=function(vec) { stopifnot(class(vec)=="integer") ret = vec[fpart(vec/2)==0] ret } Some are minor additions that have proven useful in answering common SO question: # Shift a vector

Two NOTE messages from R CMD check --as-cran

ⅰ亾dé卋堺 提交于 2019-12-12 03:59:17
问题 In the process of submitting an R package to CRAN, I could not resolve two issues the reviewer encountered on his system: 1.) Package has help file(s) containing build-stage \Sexpr{} expresssons but no 'build/partial.rdb' file. 2.) Checking URLs failed with message: /home/tmp/CRAN/mypackage.Rcheck/00_pkg_src/mypackage/man/mypackage-package.Rd:6: file ‘./DESCRIPTION’ does not exist The DESCRIPTION-file is included in the right place. Unfortunately I cannot give any additional details at this

How to load compiled library in an R package

瘦欲@ 提交于 2019-12-11 23:33:46
问题 I am writing an R package where I need to include a compiled library file qserver.dll and dym.load it when the package is loaded in R throught library(myPackage). This qserver.dll is provided by a third party vendor so I don't have the source code. I did some research on the internet but information is rare. What I have found so far is that I should put this file in the to inst/ subdirectory of my package folder. However, how I can determine the path to this file when writing the package so I

Error: Required package curl not found. Please run: install.packages('curl') Execution halted on Travis CI

﹥>﹥吖頭↗ 提交于 2019-12-11 17:26:13
问题 An R package works fine (and passes CRAN checks), but when Travis CI runs unit tests it errors with Error: Required package curl not found. Please run: install.packages('curl') Execution halted This seems to be an issue particular to Ubuntu. I can see here that running sudo apt-get install libcurl4-openssl-dev can fix the issue. The trouble is I don't have access to the Ubuntu console (as Travis CI does everything after I push to git) - can I place this code somewhere? E.g. can it go in

Workaround to allow badges in package README.md on github but not in CRAN version

只愿长相守 提交于 2019-12-11 15:33:24
问题 R CMD check packagename_0.1.1.tar.gz --as-cran produces a WARNING if badges are present in README.md . This causes consequences like travis CI to fail (since it treats warnings as errors) Is there a workaround to get the check to pass without removing the badges? 来源: https://stackoverflow.com/questions/56346524/workaround-to-allow-badges-in-package-readme-md-on-github-but-not-in-cran-versio