Search code examples
c#.netvb.netr.net

How do I break long line in RDotNet?


How can I do to break the long line of my R scripts used to run in c#? For example, if I have this code:

engine.evalute("f.rf=function(i) { NBR_ACH<-ALL_DATA[-intrain,1] set.seed(7) MD.NBR_ACH=randomForest(NBR_ACH~.,data=training,mtry=i,importance=TRUE,ntree=1000) NBResti=predict(MD.NBR_ACH,newdata=testing)c(i,round(sqrt(mean(sum((1-NBResti/NBR_ACH)^2)))/sqrt(length(NBR_ACH)),4))");

In R, it's easier just we do the , and it works very well!


Solution

  • You could use the verbatim string syntax which allows line breaks and put your line breaks where you would do them in R:

    @"Line1
    Line2"