[Rd] Parser bug? A comma too much.

Avraham Adler @vr@h@m@@d|er @end|ng |rom gm@||@com
Fri Sep 16 16:39:50 CEST 2022


That may actually be the case for EVERY default plot, if I understand
correctly. The default S# plot is defined as

## Default S3 method:
plot(x, y = NULL, type = "p",  xlim = NULL, ylim = NULL,
     log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL,
     ann = par("ann"), axes = TRUE, frame.plot = axes,
     panel.first = NULL, panel.last = NULL, asp = NA,
     xgap.axis = NA, ygap.axis = NA,
     ...)

By putting in the comma, unless I am mistaken, you are effectively
saying the second element is NULL, which is how it's naturally
defined.

Thanks,

Avi

On Fri, Sep 16, 2022 at 2:33 PM Rui Barradas <ruipbarradas using sapo.pt> wrote:
>
> Hello,
>
> Why doesn't the comma throw an error?
>
>
> plot(1:5,)    # works, no complaints
>
>
> Shouldn't this be considered a bug? I would expect the parser to at
> least give a warning.
>
>
> sessionInfo()
> R version 4.2.1 (2022-06-23 ucrt)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 22000)
>
> Matrix products: default
>
> locale:
> [1] LC_COLLATE=Portuguese_Portugal.utf8
> LC_CTYPE=Portuguese_Portugal.utf8
> [3] LC_MONETARY=Portuguese_Portugal.utf8 LC_NUMERIC=C
>
> [5] LC_TIME=Portuguese_Portugal.utf8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_4.2.1
>
>
> Rui Barradas
>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list