Skip to content

Tweak the view function #1551

Description

@olivroy

Hi, could the view function use rlang::is_interactive() so it is easier to tweak and silence it with

options(rlang_interactive = FALSE)

https://rlang.r-lib.org/reference/is_interactive.html?q=interactive#null

I'd be happy to contribute a PR, just changing this line

if (!interactive()) return(invisible(x))

with

if (!rlang::is_interactive())   return(invisible(x))

Thanks

When writing code, I put calls to view in some places, but it would be handy to deactivate them when sourcing, instead of having to comment them out.

Edit: usethis asks that code doesn't contain interactive()
https://github.com/r-lib/usethis/blob/main/.github/workflows/lint-undesirable-functions.yaml#L64

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