There a a few documents which could help you with this.
For starters, you can to use the SSE R-Plugin. You'll find everything about that and how to install it at https://github.com/qlik-oss/sse-r-plugin
Furthermore you should read the suggested topics in Advanced Analytics Integration
That should be enough for the beginning.