Thank you, jcl. The correct use of the NEURAL function is clear now. For completeness, I used string formatting to access the "model" parameter as follows:

Code:
if(!Rx(strf("modellist[[%d+1]] <- train(Data[, c(1,2)], Data[, 20], method = 'knn')", model)) return 0;



A simple hack for using the model training capacity of the caret package is to name the items in the algo loop so that they correspond with methods in caret and then access those methods via string formatting and the "Algo" variable. For example, the following trains a k-nearest neighbours model and a random forest model and stores them in the list "modellist":

Code:
if(mode == NEURAL_TRAIN) {
...
if(!Rx(strf("modellist[[%d+1]] <- train(Data[, c(1,2)], Data[, 20], method = '%s')",model, Algo)) return 0;
...
}
...
while(algo(loop("knn", "rf"))) {
...