Displaying 2 results from an estimated 2 matches for "pars1".
Did you mean:
parse
2002 Dec 12
0
if problem in function
...lfunk<- function(datamat, tradhogst=c("trad", "h?gst"))
{
# first pick out correct parameter sets. They depend on tree species
# if tree speciec is bjork (birch) -> choose
bjork.formh?jd.pars
# and bjork.h?jd.pars as pars1 and pars2, respectively
#
if(datamat$tree.spec == "Bj?rk") {
pars1<- bj?rk.formh?jd.pars
pars2<- bj?rk.h?jd.pars
}
# if tree species is pine...
if( da...
2008 Jan 22
2
R object as a function
I want to use a function as an argument to ingtegrate it twice.
See the following (senseless) example of a double integration:
test<-function(sf,lo,up,rest) {
innerFkn<-function(sf,lo) {
inte=integrate(f=sf,lower=lo,upper=4)
return( inte$value )
}
integral=integrate(f=innerFkn,lower=1,upper=2,sf=sf,lo=lo,up=up)
return( integral$vlaue+rest )
}