Skip to content

No correct formatting in accessing multiple elements in 3D matrix #145

@richelbilderbeek

Description

@richelbilderbeek

(I attached a vignette as PDF showing this with nicer layout)

As a good friend of @lintr-bot, I found out it was impossible to satisfy him/her/it in the following occasion:

Suppose a 3D matrix:

m <- array(1:8, c(2, 2, 2))

Let's say I want the 2nd columns of the second depth.

Here, lintr will complain about the presence of a
space before the comma before the second 2:

a <- m[2, , 2]

Here, lintr will complain about the space absent after the comma of
the first 2:

b <- m[2,, 2]

This results in the following errors:

bug_report_lintr.Rmd:24:11: style: Commas should never have a space before.
a <- m[2, , 2]
bug_report_lintr.Rmd:31:10: style: Commas should always have a space after.
b <- m[2,, 2]

Thus, there is no correct formatting possible here. I suggest to allow one of these formats :-)

Thanks for lintr and @lintr-bot !

Vignette here: bug_report_lintr.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions