This work has been started [here](https://github.com/xtensor-stack/xtensor-r/pull/152) but is not finished.