SCM

SCM Repository

[blotter] Diff of /pkg/quantstrat/R/paramsets.R
ViewVC logotype

Diff of /pkg/quantstrat/R/paramsets.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1564, Mon Nov 4 16:53:04 2013 UTC revision 1565, Mon Nov 4 20:15:00 2013 UTC
# Line 36  Line 36 
36  #  #
37  ###############################################################################  ###############################################################################
38    
39    # TODO: fix put.portfolio() to use environments
40    # TODO: fix expand.grid
41    # TODO: "and" multiple constraints i.o. "or"
42    
43    
44  #require(foreach, quietly=TRUE)  #require(foreach, quietly=TRUE)
45  require('foreach')  require('foreach')
46  #require(iterators, quietly=TRUE)  #require(iterators, quietly=TRUE)
# Line 141  Line 146 
146      nsamples <- min(nsamples, nrow(param.combos))      nsamples <- min(nsamples, nrow(param.combos))
147    
148      param.combos <- param.combos[sample(nrow(param.combos), size=nsamples),]      param.combos <- param.combos[sample(nrow(param.combos), size=nsamples),]
149    
150        if(NCOL(param.combos) == 1)
151            param.combos <- param.combos[order(param.combos)]
152        else
153      param.combos <- param.combos[with(param.combos,order(param.combos[,1],param.combos[,2])),]      param.combos <- param.combos[with(param.combos,order(param.combos[,1],param.combos[,2])),]
154    
155      param.combos      data.frame(param.combos)
156  }  }
157    
158  install.param.combo <- function(strategy, param.combo, paramset.label)  install.param.combo <- function(strategy, param.combo, paramset.label)

Legend:
Removed from v.1564  
changed lines
  Added in v.1565

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge