I'm testing different ways to connect Qlik Sense and R. This sample application runs an R script by a call to a batch file. Relative paths and a change to the default security settings in Qlik Sense are used in the sample file, but it can be configured without the relative paths.
The R script loads the iris data set from iris.csv. The data is split into training, testing and validation sets. A random forest model is used to predict the species from the data. The predictions of the validation set are appended to the validation data set. It is then exported to a new csv which is picked up by Qlik Sense.