[Rd] Strange behaviour of methods::slot() when returning a tibble

Stephen Martin Pederson @tephen@peder@on @end|ng |rom @de|@|de@edu@@u
Fri Jul 10 17:54:02 CEST 2020


I have an S4 object class defined in a Bioconductor package which contains multiple slots, some of which are tibbles, whilst others are vectors. If I call

slot(object, name)

where 'name' is an slot that contains a vector, everything works as expected. However, when I call slot(object, name) where 'name' is an slot that contains a tibble I get the following warning:


Warning message:
`...` is not empty.

We detected these problematic arguments:
* `needs_dots`

These dots only exist to allow future extensions and should be empty.
Did you misspecify an argument?
Making 'packages.html' ... done

Wrapping the call in suppressWarnings() doesn't stop this, and this warning is printed every time the resultant object is called, e.g. df <- slot(object, name); df, would not print the error on the first call, but would print the warning every time df is  printed.

For an MWE


setClass("track", slots = c(x="numeric", y="data.frame"))
myTrack <- new("track", x = -4:4, y = tibble(y = 1))

myTrack

df <- slot(myTrack, "y")
df

The package passes R CMD check even though this warning is produced in most examples. Changing to a generic S3 data.frame also doesn't produce this error. I'm running the following configuration:


R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8
 [4] LC_COLLATE=en_AU.UTF-8     LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                  LC_ADDRESS=C
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ngsReports_1.5.3    tibble_3.0.2        ggplot2_3.3.2       BiocGenerics_0.34.0

Thanks in advance,

Steve

	[[alternative HTML version deleted]]



More information about the R-devel mailing list