search for: funa

Displaying 7 results from an estimated 7 matches for "funa".

Did you mean: fun
2015 Jul 03
1
Are downstream dependencies rebuilt when a package is updated on CRAN?
...ages, of course.) The reason I ask is because there are cases where this can cause problems. Suppose that when pkgB is built, it calls pkgA::makeClosure(), which returns a closure that refers to a function in pkgA. Suppose this code is in pkgA 1.0: makeClosure <- function() { function() { funA() } } funA <- function() "funA was called!" And this is the code in pkgB: foo <- pkgA::makeClosure() After building and installing pkgB, you can do this, which gives the expected result: > pkgB::foo() [1] "funA was called!" Now suppose pkgA is upgraded to 2.0, a...
2008 May 15
1
logistic transformation using nlminb
...(5) corr[lower.tri(corr)] <- 0.5 corr[upper.tri(corr)] <- 0.5 # Data for the minimisation mat <- rmvnorm(10000, mean=c(3, 2.75, 2.8, 3, 2.9), sd=c(0.1, 0.1,0.12, 0.15, 0.10), cov=corr) # here is the simple optimisation function that allows the 5th element to be potentially negative obj.funA <- function(opt, mat) { opt <- c(opt, 1-sum(opt)) LinearComb <- mat%*%opt obj <- -min(LinearComb) obj } # I want to put an upper boundary constraint on the first variable - not being greater than 0.35 and the rest being between 0 and 1 opt <- nlminb(rep(0,4), lower=...
2024 Aug 09
3
If loop
...fact it's in a function is making things clearer. > > Are you trying to update the values of an object from within the function, > and have them available outside the function. I don't speak functional > programming articulately enough but basically > > v <- 1 > > funA <- function() { > v <- v+1 > } > > funA() > cat (v) > > # 1 > > You either return the v from the function so > > funB <- function() { > v <- v+1 > return (v) > } > > v <- funB() > cat (v) > #2 > > Or use <<- assignment...
2024 Aug 09
2
If loop
OK. The fact it's in a function is making things clearer. Are you trying to update the values of an object from within the function, and have them available outside the function. I don't speak functional programming articulately enough but basically v <- 1 funA <- function() { v <- v+1 } funA() cat (v) # 1 You either return the v from the function so funB <- function() { v <- v+1 return (v) } v <- funB() cat (v) #2 Or use <<- assignment I think. (I usually return, but return can only return one object and I think you want two o...
2024 Aug 09
1
If loop
Thanks. Hmm. The loop is doing what it is supposed to do. > try1<-function(joint12=FALSE,marg1=FALSE,marg2=FALSE, +??????????????? cond12=FALSE,cond21=FALSE){ + # *************************************************** + # Testing if loop + # *************************************************** + if(joint12){ +?? {print ("joint12"); cat(joint12,"\n")} +?? {print
2011 Sep 06
2
Generalizing call to function
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
2014 Nov 27
1
Problem understanding behaviour of versionCheck for loadNamespace (and when versions for Imports packages are checked)
Hi Duncan, Many thanks (yet again). With the hint given by your earlier email (viz that currently loadNamespace expects a 3rd component called name in the list that is used for the versionCheck argument) I had another look at what was going on with my toy examples yesterday evening. I'm still working on my issue, but thus far I have: 1) Confirmed that internal calls to loadNamespace