berndbischl / BBmisc

Other
20 stars 7 forks source link

ensureVector extension #60

Closed jakobbossek closed 8 years ago

jakobbossek commented 8 years ago

I would like to extend ensurevector in the following sense:

ensureVector(x, n = 1L, cl = c("A", "B"))
ensureVector("classif.rpart", n = 1L, cl = "character") # vector
ensureVector(makeLearner("classif.rpart"), n = 1L, cl = "Learner") # list

Sometimes we want a list in any case. So my proposal is to add a logical flag ensure.list with default FALSE.

berndbischl commented 8 years ago

i like what you say.

i would suggest also:

do a PR?

jakobbossek commented 8 years ago

Jup. PR incoming soon 😉

jakobbossek commented 8 years ago

Done via merged PR #63.

jakobbossek commented 8 years ago

Thanks for merging.