RobinHankin / clifford

https://robinhankin.github.io/clifford/
5 stars 0 forks source link

RStudio run examples gives warning for ?rcliff #70

Closed RobinHankin closed 2 years ago

RobinHankin commented 2 years ago

Installed R-4.2-0 and RStudio 2022.02.1+461, playing with the "Run examples" functionality for rcliff(). Find this:

### ** Examples

rcliff()
Warning in clifford(replicate(n, sort(sample(d, f())), simplify =
FALSE), : repeated element in terms

Looking at rcliff I see:

 op <- options()
    options(warn = 0)
    out <- clifford(replicate(n, sort(sample(d, f())), simplify = FALSE), 
        sample(n) - round(n/2))
    options(op)

I'll need to check, but it would seem that suppressWarnings() would be better?

RobinHankin commented 2 years ago

Function clifford() includes the lines

 if (!isFALSE(getOption("warn_on_repeats")) & anyDuplicated(terms) > 
        0) {
        warning("repeated element in terms")
    }

but I am not sure how setting this option would work in the context of RStudio help files.