similar to: Functions within functions in R and S-Plus

Displaying 20 results from an estimated 30000 matches similar to: "Functions within functions in R and S-Plus"

2016 Mar 14
4
LLVM 3.8 change in function argument lists?
Hi, I am upgrading my project from 3.7 to 3.8. I find that following code used to compile in 3.7 but doesn't in 3.8 and I can't understand why. llvm::Function *mainFunc = ...; auto argiter = mainFunc->arg_begin(); llvm::Value *arg1 = argiter++; arg1->setName("obj"); But if I change the code to following it compiles: auto argiter = mainFunc->arg_begin(); llvm::Value
2013 May 21
1
[LLVMdev] Is it valid to add parameters to a function once it is created
I create a function with an empty signature: void llvm_start_new_function() { llvm::outs() << "Staring new LLVM function ...\n"; Mod = new llvm::Module("module", llvm::getGlobalContext()); builder = new llvm::IRBuilder<>(llvm::getGlobalContext()); llvm::FunctionType *funcType = llvm::FunctionType::get(builder->getVoidTy(), false);
2013 May 22
1
[LLVMdev] Best strategy to add a parameter to a function
I am trying to build a function (C++ Builder) and at the same time extend its parameter set. Here's what I try to do: Value* arg0 = add_param_float("arg0"); Value* tmp = builder->CreateFAdd(arg0,some_previous_value); Value* arg1 = add_param_float("arg1"); The function add_param_float should add a 'float' parameter to the function and return its value. Right
2015 Mar 10
4
[LLVMdev] noob IR builder question
I am trying to get a handle on IR builder, at least some basics. I ran through a tutorial here: Create a working compiler with the LLVM framework, Part 1 <http://www.ibm.com/developerworks/library/os-createcompilerllvm1/>, and it worked well enough. I have some simple code that creates a hello world IR. I am trying to now bring in some concepts from the Kaleidoscope tutorial, namely
2007 Jul 24
1
Passing equations as arguments
Friends, I'm trying to pass an equation as an argument to a function. The idea is as follows. Let us say i write an independent function Ideal Situation: ifunc <- function(x) { return((x*x)-2) } mainfunc <- function(a,b) { evala <- ifunc(a) evalb <- ifunc(b) if (evala>evalb){return(evala)} else return(evalb) } Now I want to try and write this entire program in a single
2011 May 04
1
hurdle, simulated power
Hi all-- We are planning an intervention study for adolescent alcohol use, and I am planning to use simulations based on a hurdle model (using the hurdle() function in package pscl) for sample size estimation. The simulation code and power code are below -- note that at the moment the "power" code is just returning the coefficients, as something isn't working quite right. The
2004 Sep 20
3
montecarlo simulation
Hy! I would like to know how run a montecarlo simulation with R. Thank you!!!! Francesca Matalucci __________________________________________________________________ Accesso Internet Gratis per utenti Excite! Attivalo subito! http://www.excite.it/hitech/accesso Il Mio Excite. Personalizza la tua Home page Excite come vuoi tu! http://www.excite.it AAA/Relazioni. Sfoglia gli annunci e trova la
2003 Aug 20
2
Method of L-BFGS-B of optim evaluate function outside of box constraints
Hi, R guys: I'm using L-BFGS-B method of optim for minimization problem. My function called besselI function which need non-negative parameter and the besselI will overflow if the parameter is too large. So I set the constraint box which is reasonable for my problem. But the point outside the box was test, and I got error. My program and the error follows. This program depends on CircStats
2010 Aug 18
1
Displaying Results in Two Columns
Could I have some suggestions as to how (various ways) I can display my confidence interval results? rm(list = ls()) set.seed(1) func <- function(d,t,beta,lambda,alpha,p.gamma,delta,B){ d <- c(5,1,5,14,3,19,1,1,4,22) t <- c(94.32,15.72,62.88,125.76,5.24,31.44,1.048,1.048,2.096,10.48) post <- matrix(0, nrow = 11, ncol = B) theta <- c(lambda,beta) beta.hat <- 2.471546 for(j
2019 Jul 08
2
Problem with the LLVM v8.0 IR 'select' instruction
Hi again, It is probably me doing something wrong, but I have attached a trimmed down sample that shows the issue and the output that Clang 8.0.0 makes (using the binary release from llvm.org). I invoke clang as follows: clang -S -O3 -o Evergrowing.s -Wall Evergrowing.ll I tried using -O1, -O2, and -O3, but all where the same. Please notice that I renamed 'main()' to
2011 Jun 27
3
Creating a Polar Plot with expanding points as radius increases
I'd like to create a polar plot similar to those created by the polarFreq function in the openair package. However, this package seems to be specific to wind speed and direction, and requires a "ws" (wind speed) and a "wd" (wind direction) column. My data is unrelated to wind speed, but I'd like to be able to get a plot that does what polarFreq's plots do; I'd
2011 Jan 25
1
deSolve: Problem solving ODE including modulo-operator
I have a problem integrating the 'standard map' ( http://en.wikipedia.org/wiki/Standard_map http://en.wikipedia.org/wiki/Standard_map ) with deSolve: By using the modulo-operator '%%' with 2*pi in the ODEs (standardmap1), the resulting values of P and Theta, should not be greater than 2pi. Because this was not the case, i was thinking that the function 'ode' has some
2009 Aug 20
1
how to compute this summation...
Dear R users, I try to compute this summation, http://www.nabble.com/file/p25054272/dd.jpg where f(y|x) = Negative Binomial(y, mu=exp(x' beta), size=1/alp) http://www.nabble.com/file/p25054272/aa.jpg http://www.nabble.com/file/p25054272/cc.jpg In fact, I tried to use "do.call" function to compute each u(y,x) before the summation, but I got an error, "Error in X[i, ]
2013 Sep 06
3
Samba4 LDAP Integration with Asterisk
Hi, I am turning crazy. I try to integrate Asterisk 11.5.1 into Samba4 LDAP, but when I import the ldif file from contrib directory I get this error. ldbmodify -H /usr/local/samba/private/sam.ldb asterisk.ldif --option="dsdb:schema update allowed"=true ERR: (No such object) "objectclass: Cannot add cn=asterisk,cn=schema,cn=config, parent does not exist!" on DN
2008 Dec 27
1
indexed expression
Hello expeRts, I need generate symbolize the autocovariances matrix of a Gaussian ARMA(1,1), for derivate it and evaluate. I try this codes, but whitout sucess vacv<-NULL vacv[1]<-1-2*phi*theta-theta^2 vacv[2]<-(1-phi*theta)*(phi-theta) vacv[3:n]<-acv[2]*(phi^(1:(n-2))) facv<-list() for(i in 1:2)
2007 Nov 30
2
finding roots (Max Like Est)
I have this maximum liklihood estimate problem i need to find the roots of the following: [sum (from i=1 to n) ] ((2(x[i]-parameter)/(1+(x[i]-parameter)^2))=0 given to me is the x vector which has length 100 how would I find the roots using R? I have 2 thoughts...... 1 is using a grid search ... eg. brute force, just choosing a whole bunch of different values for my parameter .... such as
2001 May 27
3
plotting circles
I'd like to make some polar plots with R, but I can't seem to find anything designed to help with that. Is there anyway to get a real polar mode, where instead of x and y you have r and theta? How about a way to draw a circle? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2010 Dec 16
1
Optim function with meta parameters
Hi guys. I have a dataset with 4 columns. In the first and second column I have the same qualitative variable referred to different teams of people. There are 10 teams in total and they compete against each other to perform a certain task whose result is stored in the third column for the team recorded in the first column, and in the fourth column for the team in the second column. For example,
2009 Aug 20
1
Understanding R code
What is 1. par.ests <- optimfit$par 2. fisher <- hessb(negloglik, par.ests, maxvalue=maxima); 3. varcov <- solve(fisher); 4. par.ses <- sqrt(diag(varcov)); Thanks a lot, fit.GEV <- function(maxima) { sigma0 <- sqrt((6. * var(maxima))/pi) mu0 <- mean(maxima) - 0.57722 * sigma0 xi0 <- 0.1 theta <- c(xi0, mu0, sigma0) #10/5/2007: removed assign() for maxima.nl
2005 Dec 04
2
Adding sortables dynamically
Hi all, is there a way to define the containment option for a sortable so that it is a class name instead of an id list? I have a case very similar to the sortable lists demo, the only difference is that I'm adding new list containers dinamically, so either I need to redo the Sortable.create calls for all new elements to include the newly added container, or having someway to have them