similar to: How to define specially nested functions

Displaying 20 results from an estimated 2000 matches similar to: "How to define specially nested functions"

2004 Sep 14
3
Getting the argument list within a function
Is there a way of getting the argument list of a function from within that function? For example, something like f <- function(x, y = 3) { fargs <- getFunctionArgList() print(fargs) ## Should be `alist(x, y = 3)' } Thanks, -roger
2017 Jun 07
2
purrr::pmap does not work
Hi All, I try to do a scatterplot for a bunch of variables. I plot a dependent variable against a bunch of independent variables: -- cut -- graphics::plot( v01_r01 ~ v08_01_up11, data = dataset, xlab = "Dependent", ylab = "Independent #1" ) -- cut -- It is tedious to repeat the statement for all independent variables. Found an alternative, i.e. : -- cut -- mu
2012 Apr 23
1
[LLVMdev] Problem about the type of Function's arguement in llvm
I read the tutorial doc and some info of SSA, finally understand it. Thanks for your help. And the segmentation error of loading arguementation occurs, (gdb error info) Program received signal SIGSEGV, Segmentation fault. 0x0855bb68 in llvm::LoadInst::LoadInst(llvm::Value*, char const*, bool, llvm::Instruction*) () code is like follows: //#include necessary header files int main(){
2012 Apr 22
0
[LLVMdev] Problem about the type of Function's arguement in llvm
hi On Sun, Apr 22, 2012 at 8:36 PM, Jianfei Hu <hujianfei258 at gmail.com> wrote: > in the  tutorial of official llvm doc, chapter 3, it deals with arguement of > function as follow: > > for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size(); >        ++AI, ++Idx) { >     AI->setName(Args[Idx]); > >     // NamedValues is map<string, Value*>
2012 Apr 22
2
[LLVMdev] Problem about the type of Function's arguement in llvm
in the tutorial of official llvm doc, chapter 3, it deals with arguement of function as follow: for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size(); ++AI, ++Idx) { AI->setName(Args[Idx]); // NamedValues is map<string, Value*> NamedValues[Args[Idx]] = AI; and when it try to get the value of arguement, it simply does: Value
2012 Apr 26
2
How does .Fortran "dqrls" work?
Hi, all. I want to write some functions like glm() so i studied it. In glm.fit(), it calls a fortran subroutine named "dqrfit" to compute least squares solutions to the system x * b = y To learn how "dqrfit" works, I just follow how glm() calls "dqrfit" by my own example, my codes are given below: > qr <- >
2012 Jan 24
2
Help: read a proportion of high through-put data
Dear All, I have a text file, tab delimited, called "sample.txt",as follows: ID_REF 382 GC_Score Theta R B_Allele_Freq Log_R_Ratio 200003 BB 0.9101527 0.9734979 0.8788951 1 0 200006 AB 0.6003323 0.4385073 2.033364 0.4850979 0.01553433 I have explored various options of the command: read.table, with one as:
2009 May 21
3
[LLVMdev] Passing a pointer to a function
I recently began hacking around with my first LLVM pass. The big picture is that I would like to insert function calls for each instruction type, and pass some parameters based on the instruction type. Then I will link the output to some C file that implements those functions. Things were going well until I started trying to make function calls with a pointer as a parameter. For example, I would
2010 Jul 07
2
how to define method for "+" function in a new class
Dear R developers, I have a new class, which I called "Molecule", and have tried to define = a "+" operation for 2 objects of this class. This is what I have written so far, although the method is not complete = (I'm trying to look at it at intermediate stages): setMethod( f=3D"+", signature(x=3D"Molecule",y=3D"Molecule"),
2011 Aug 24
2
Help: find the index of the minimum of entries
Dear All, I would like to ask a question on how to find the index of the minimum of entries of a numeric vector, without using loops or user defined functions. Suppose we have a vector: a <- c(3,1,2) then, min(a) = 1 and its index is 2. Target: how to get the index of this minimum? How to get the indices if multiple entries assume this same minimum? Thank you, Chee [[alternative HTML
2003 Jul 15
5
passwd program not called as root
Hallo to everybody out there, I have downloaded and compiled Samba3b2 on a SuSE 8.2 machine. For testing purpose, I connect to this machine with a Win2k-Box ... most things seem to work fine, but I am unable so change passwords from the win-box with unix password sync enanbled. I changed loglevel to 103 and enabled password chat debug. From what I found in the log-files, I can conclude that
2011 Sep 20
2
Is it possible to pass a function argument from R to compiled code in C?
I have a function in R that takes another function as argument: f <- function(g, ...) { #g is expected to be a function } I want to see if there is a way to implement "f" in C and calling it from R using ".C" interface. I know that I can use function pointers for my C implementation, but I imagine it's going to be nearly impossible to pass a function from R to C. Are
2004 Dec 01
3
core dump during make check when building 64-bit R on Solaris8/9
Hi, After reading some of the posting in this list, I came across this posting from: From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk> Date: Fri 29 Oct 2004 - 08:02:40 EST Replying to Re: [R] Errors during make check He described a problem similar to mine, that build 64-bit R (I am building R version 2.0.1) with sunperf library gives a core dump during make check. So I configured my
2020 Oct 06
4
Solving a simple linear equation using uniroot give error object 'x' not found
Colleagues, I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, Error in yfu n(x,10,20) : object 'x' not found. I hope someone can tell we how I can fix the problem
2011 Mar 15
1
Problem with nls.lm function of minpack.lm package.
Dear R useRs, I have a problem with nls.lm function of minpackl.lm package. I need to fit the Van Genuchten Model to a set of data of Theta and hydraulic conductivity with nls.lm function of minpack.lm package. For the first fit, the parameter estimates keep changing even after 1000 iterations (Th) and I have a following error message for fit of hydraulic conductivity (k); Reason for
2003 Aug 21
3
Conference + time limit
Hello Conference again. Meetme can now limit number of users in a room. Can it also limit how long a conference session? Someone ask the same question (from achive) but doesn't have a solid answer. Foong -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20030821/c1ca1383/attachment.htm
2007 Apr 25
4
How to solve difficult equations?
This below is not solvable with uniroot to find "a": fn=function(a){ b=(0.7/a)-a (1/(a+b+1))-0.0025 } uniroot(fn,c(-500,500)) gives "Error in uniroot(fn, c(-500, 500)) : f() values at end points not of opposite sign" I read R-help posts and someone wrote a function: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/92407.html but it is not very precise. Is there any
2013 May 30
2
RFC: a "safe" uniroot() function for future R
With main R releases only happening yearly in spring, now is good time to consider *and* discuss new features for what we often call "R-devel" and more officially is R Under development (unstable) (.....) -- "Unsuffered Consequences" Here is one such example I hereby expose to public scrutiny: A few minutes ago, I've committed the following to R-devel (the
2012 Jun 22
4
Uniroot error message with in intergration
Dear all I am trying to calculate the value of n using uniroot. Here is the message I am having: <<< Error in uniroot(integ, lower = 0, upper = 1000, n) : 'interval' must be a vector of length 2 >>> Please would you be able to give me an indication on why I am having this error message. Many thanks EXAMPLE BELOW: ## t = statistics test from t -distribution
2018 Jul 30
2
trace in uniroot() ?
In looking at rootfinding for the histoRicalg project (see gitlab.com/nashjc/histoRicalg), I thought I would check how uniroot() solves some problems. The following short example ff <- function(x){ exp(0.5*x) - 2 } ff(2) ff(1) uniroot(ff, 0, 10) uniroot(ff, c(0, 10), trace=1) uniroot(ff, c(0, 10), trace=TRUE) shows that the trace parameter, as described in the Rd file, does not seem to be