alanocallaghan/scater

partial match argument warning/error

Closed this issue · 4 comments

Hi Alan, @alanocallaghan

It looks like plotColData is using a partial argument $val instead of the full name $value or even better [["value"]].
To reproduce, you can set the option options(warn = 2L) or add the options in the chunk below.
Here is the error:

>     options(warn = 2L)
>     suppressPackageStartupMessages({
+         library(TENxPBMCData)
+         library(scater)
+     })
>     sce <- TENxPBMCData("pbmc3k")
snapshotDate(): 2023-04-04
see ?TENxPBMCData and browseVignettes('TENxPBMCData') for documentation
loading from cache
>     sce$nCounts <- colSums(counts(sce))
>     plotColData(sce, "nCounts")
Error in y_by_out$val : 
  (converted from warning) partial match of 'val' to 'value'

https://github.com/Alanocallaghan/scater/blob/60e1a8b0a01a80d838e58dab101608391836006d/R/plotColData.R#L73

FWIW, I keep these options in my ~/.Rprofile for good practice:

options(
    warnPartialMatchAttr = TRUE,
    warnPartialMatchDollar = TRUE,
    warnPartialMatchArgs = TRUE
)

see here for reference
https://kevinushey.github.io/blog/2015/02/02/rprofile-essentials/

Best,
Marcel

Thanks, sorry for the delay as I'm on leave but will fix this next week

No worries. Thanks Alan @alanocallaghan

I tried adding this to the test suite but I just get an avalanche of warnings from (eg) ggplot2, pheatmap using partial matching internally

Thanks Alan!