RobinHankin / frab

1 stars 0 forks source link

Function `frab()` really should be able to take a named _logical_ vector #11

Closed RobinHankin closed 6 months ago

RobinHankin commented 1 year ago

and it can't:

library("frab")
#> 
#> Attaching package: 'frab'
#> The following objects are masked from 'package:base':
#> 
#>     pmax, pmin
frab(c(a=TRUE,b=TRUE,c=FALSE,d=TRUE))
#> Error in frab(c(a = TRUE, b = TRUE, c = FALSE, d = TRUE)): is.namedvector(x) is not TRUE

Created on 2023-07-26 with reprex v2.0.2

RobinHankin commented 1 year ago

Changing the frab class declaration from setClass("frab",slots=c(x="numeric")) to setClass("frab",slots=c(x="ANY")) actually results in a buildable package that passes R CMD check cleanly (!). However:

library("frab")
#> 
#> Attaching package: 'frab'
#> The following objects are masked from 'package:base':
#> 
#>     pmax, pmin
frab(c(a=TRUE,b=TRUE,c=FALSE,d=TRUE))
#> A frab object with entries
#> a b d 
#> 1 1 1

See how the entry for "c" vanishes.

RobinHankin commented 1 year ago

started work documenting this at inst/wittgenstein.Rmd

RobinHankin commented 6 months ago

changed my mind.