Comments (2)
You seem to misunderstand what the manual says: the possible values for the names
argument of checkCharacter
are listed in ?checkNamed
(see the type
argument). So you can have sthing like:
checkCharacter(c(a = "A", b = "B"), names = "unique") # this passes
#checkCharacter(c(a = "A", b = "B"), names = "unnamed") # this fails
If you want to check for a specific set of names, you have to use checkSubset
:
x <- c(a = "A", b = "B")
assert(
checkCharacter(x),
checkSubset(names(x), choices = base::letters),
combine = "and"
)
from checkmate.
Ah, thanks, especially for typing out the examples!!
clear now!
from checkmate.
Related Issues (20)
- Check on names does not error when using R keywords [suggestion] HOT 1
- assertString(na.ok = TRUE) does not check whether NA is a character-type HOT 1
- `check_number(2, lower = Inf)` is `TRUE` HOT 2
- `reportAssertions` always reports errors from top level
- [Feature requrest] `assertBool` HOT 1
- 2 tests in test_checkIntegerish.R fail on 32-bit platforms [ FAIL 2 | WARN 0 | SKIP 1 | PASS 3004 ] HOT 3
- unwanted warning with `makeAssertCollection`
- mini issue: Possibility of testing if a number is strictly greater than another HOT 1
- testScalarNA and data.table HOT 1
- [feature request] pipe friendly assert/test statements
- checkNamed, assertNamed: unhelpful assretion error message
- Original variable name does not appear when `matchArg` doesn't find choice
- Adding Support for S7 Class Checking?
- `assert_date` NA missing behavior inconsistent with `assert_numeric` and others HOT 1
- add sorted argument to expect_date
- sorted option not enforced when sort violations bridge NA HOT 2
- possibly add sorted = FALSE to ls() calls to increase performance HOT 1
- Proposal: Add a quick summary of the prefixes to the docs
- Enabling PCRE RegEx patterns
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkmate.