Re: [R-pkg-devel] Errors in R package - Updated

2018-05-25 Thread Duncan Murdoch
On 25/05/2018 3:25 PM, Steven Spiriti wrote: To Whom It May Concern: I have created a package called "freeknotsplines" in R, and I need to make a few updates to it. I resubmitted the package, and received the following error message: The problem is that you are mixing up S3 and S4

Re: [R-pkg-devel] Courtesy methods and explosive dependencies

2018-05-25 Thread Duncan Murdoch
On 25/05/2018 3:22 PM, Lenth, Russell V wrote: There can't really be an "ImportGenerics", because S3 is so informal. A generic function is a function that calls UseMethod, but it can do anything else as well. So R would need some fancy code analysis to know whether it was safe to import the

[Rd] readLines function with R >= 3.5.0

2018-05-25 Thread Ralf Stubner
Dear all, I would like to draw you attention to this question on SO: https://stackoverflow.com/questions/50372043/readlines-function-with-new-version-of-r Based on the OP's code I used the script ### create_matrix <- function() { cat("Write the numbers of

[R-pkg-devel] Errors in R package - Updated

2018-05-25 Thread Steven Spiriti
To Whom It May Concern: I have created a package called "freeknotsplines" in R, and I need to make a few updates to it. I resubmitted the package, and received the following error message: checking examples ... ERROR Running examples in ‘freeknotsplines-Ex.R’ failed The error most likely

Re: [R-pkg-devel] Courtesy methods and explosive dependencies

2018-05-25 Thread Lenth, Russell V
> There can't really be an "ImportGenerics", because S3 is so informal. A > generic function is a function that calls UseMethod, but it can do anything > else as well. So R would need some fancy code analysis to know whether it > was safe to import the generic but not all the dependencies of

Re: [R-pkg-devel] Courtesy methods and explosive dependencies

2018-05-25 Thread Duncan Murdoch
On 25/05/2018 11:38 AM, Lenth, Russell V wrote: I agree that most of the package dependencies in multcomp are worth having, but that is not the point. The point is that if a developer wants to write a method for a generic function offered in another non-base package, that creates false

Re: [Bioc-devel] How best to remap S4Vectors::Hits indices?

2018-05-25 Thread Hervé Pagès
Hi Pariksheet, On 05/22/2018 04:57 PM, Pariksheet Nanda wrote: Hi folks, I'm working on a package that does some trivial GRanges position classifications; primarily to standardize nomenclature according to the literature in workflows. The API for S4Vectors::Hits() generally doesn't seem

Re: [R-pkg-devel] Courtesy methods and explosive dependencies

2018-05-25 Thread Neal Fultz
In the estimatr package, we provided a shim to support broom without transitively depending on the tidyverse: tidy <- function(object, ...) { if (requireNamespace("broom", quietly = TRUE)) broom::tidy(object, ...) else UseMethod("tidy") }

Re: [R-pkg-devel] Courtesy methods and explosive dependencies

2018-05-25 Thread Lenth, Russell V
I agree that most of the package dependencies in multcomp are worth having, but that is not the point. The point is that if a developer wants to write a method for a generic function offered in another non-base package, that creates false dependencies: packages that users are required to have,

Re: [Rd] Rd parser throws error for user macros invoked with empty argument

2018-05-25 Thread Georgi Boshnakov
While on the topic of Rd macro arguments, it seems that if a multiline argument is supplied, the lines after the first are silently ignored: f <- tempfile() mac6 <- "\\newcommand{\\mac6}{mac6: #1}" cat(mac6, "\\mac6{2*3 2+2 sin(pi) }\n", file = f) rd <- tools::parse_Rd(f) > rd mac6: 2*3 ---

Re: [R-pkg-devel] Courtesy methods and explosive dependencies

2018-05-25 Thread Ben Bolker
Russ Lenth may have picked a suboptimal example (we could search through the dependencies of emmeans for an example with more non-(base+recommended) recursive dependencies, but the general point definitely holds. "(formally undefined) recommended-level-2 R packages" seems like a can of worms (I

Re: [Rd] patch for scan.c for long vector support

2018-05-25 Thread Tomas Kalibera
Thanks for the report, fixed in R-devel 74782. Please report back if the fix is not sufficient for your use case. Tomas On 05/23/2018 06:16 AM, Aaron Goodman wrote: I noticed that scan.c does not yet support long vectors. It was causing a problem in the rstan library

Re: [Rd] Rd parser throws error for user macros invoked with empty argument

2018-05-25 Thread Georgi Boshnakov
Thanks for looking into this, empty string is the natural solution indeed. Georgi -Original Message- From: Tomas Kalibera [mailto:tomas.kalib...@gmail.com] Sent: 25 May 2018 10:05 To: Georgi Boshnakov; r-devel@r-project.org Subject: Re: [Rd] Rd parser throws error for user macros

Re: [Rd] Rd parser throws error for user macros invoked with empty argument

2018-05-25 Thread Tomas Kalibera
Thanks for the report and the examples - and they do not have to be that verbose, it is enough to just define and use a command, e.g. cat("\\newcommand{\\mac1}{MAC1:#1}\\mac1{}", file=f) rd <- tools::parse_Rd(f) Whenever you get an error message like "Value of SET_STRING_ELT() must be a

Re: [R-pkg-devel] Errors in my package

2018-05-25 Thread Joris Meys
On Thu, May 24, 2018 at 10:11 PM, Steven Spiriti wrote: > > > x <- 0:30/30 > > truey <- x*sin(10*x) > > set.seed(10556) > > y <- truey + rnorm(31, 0, 0.2) > > xy.freekt <- freelsgen(x, y, degree = 2, numknot = 2, 555) > > coef(xy.freekt) > Error: $ operator not defined

Re: [R-pkg-devel] Creating S3 methods for S4 classes

2018-05-25 Thread Georgi Boshnakov
Dear Martin, Thanks for the clarification and sorry for the noise. Georgi -Original Message- From: Martin Maechler [mailto:maech...@stat.math.ethz.ch] Sent: 25 May 2018 09:11 To: Georgi Boshnakov Cc: joris.m...@ugent.be; R Package Development Subject: Re: [R-pkg-devel] Creating S3

Re: [R-pkg-devel] Creating S3 methods for S4 classes

2018-05-25 Thread Martin Maechler
> Georgi Boshnakov > on Thu, 24 May 2018 16:07:43 + writes: > Hi Joris, At least some aspects of this topic are of > interest on this list, given its complexity. I'm sorry, Georgi, but "of interest" (to some readers) still does not make this the correct mailing list for

[Rd] Illegible Long S4 Methods in Reference Manual Index

2018-05-25 Thread Dario Strbenac
Good day, If there are S4 methods documented in an R package of the form functionName,aVariableType,anotherVariableType-method and some of the variable types have lengthy names and are defined in other developers' packages, such as MultiAssayExperiment, the Index section of the reference