[R] [packages Sensitivity] Fast99 function,why model runs only 1

2013-07-24 Thread
library(XML) # Load the XML packages library(sensitivity) source("Yield_APSIM.R") yield_sa <- fast99(model = Yield_APSIM, factors=c("grains_per_gram_stem", "potential_grain_filling_rate", "poten

[R] [XML packages] how to get the sub-node according to the sub-node's attribute?

2013-07-11 Thread
For example fileName <- system.file("exampleData", "mtcars.xml", package="XML") doc <- xmlTreeParse(fileName) r<-xmlRoot(doc) record<-r[["record"]] record the result : 21.0 6 160.0 110 3.90 2.620 16.46 0 14 4 but in the mecars.xml there are 32 sub-nodes called "record" when I us

[R] wrong when use the function fast99 in package "Sensitivity"

2013-07-09 Thread
Pn_I<-function(x){ I<-1000 Rp<-x[4]*(1-x[5]*I)*I/(1+x[6]*I) Pn<-x[1]*(1-x[2]*I)*I/(1+x[3]*I)-Rp-x[7] return(Pn) } Pn_I_sensitivity <- fast99(model = Pn_I, factors=c("alpha","beta","gamma","delta","lammda","omiga","Rd"), n = 3000,q =rep("qunif",7), q.ar