## Is true really true?

An often forgotten R-function while developing: `isTRUE()`

and it’s brother `isFALSE()`

.
Have you found yourself in the situation that you had to write

Much shorter is the following:

A small package to interface the SMAC optimizer from R.

co-author and maintainer mlrMBO - the comprehensive toolbox for model-based optimization in R.

A package that enables easy effortless hyper parameter optimization for mlr.

co-author of mlr - the huge R-package for machine learning.

Maintainer and co-author of the mlr-blog.

An often forgotten R-function while developing: `isTRUE()`

and it’s brother `isFALSE()`

.
Have you found yourself in the situation that you had to write

Much shorter is the following:

When writing *R* functions always remind yourself to think about if it can happen that you accidentally just select one column of a `data.frame`

.
This will result in vector which might not be what you expect in the following code.
One good practice is to always use `drop=FALSE`

when you intend to get a `data.frame`

and use the `[[]]`

notation if you expect a vector.

Lets assume cols is a vector which only sometimes has the length one, then we would do the following:

And to purposefully select a vector:

Sometimes you have to work with `base::plot`

and to combine multiple plots the solution is e.g. `par(mfrow=c(1,2), ...)`

.
Unfortunately using `par`

can mess up all your future plots in the active R session.
This is one handy trick to get back to the default settings for plotting: