similar to: Abrupt closure of R when using .C function

Displaying 20 results from an estimated 6000 matches similar to: "Abrupt closure of R when using .C function"

2019 Jul 24
1
Re: [PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
On 7/24/19 11:54 AM, Richard W.M. Jones wrote: > Previously closures had a crude flag which tells if they are > persistent or transient. Transient closures (flag = false) last for > the lifetime of the currently called libnbd function. Persistent > closures had an indefinite lifetime which could last for as long as > the handle. In language bindings handling persistent closures
2019 Jul 24
2
Re: [PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
On 7/24/19 7:17 AM, Richard W.M. Jones wrote: > In preparation for closure lifetimes, split up the Closure so it no > longer describes a list of closures, but a single callback. > > This changes the API because functions which take 2 or more closures > now pass a separate user_data for each one. > --- > docs/libnbd.pod | 3 +- >
2019 Jul 16
1
Re: [PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
On 7/16/19 6:04 AM, Richard W.M. Jones wrote: > A Closure is a list of (usually one, but can be more) closures. In C > there is also a singe ‘void *user_data’ parameter which is passed by > the caller into the function and through as the first parameter of > each callback invocation. > > By grouping the previously separate Opaque and Callback* parameters > together we can
2009 Mar 15
2
builtin vs. closure
Dear R Gurus: I'm working slowly through "R Programming for Bioinformatics", which is really interesting! Anyway, my question now is: what determines if a function is a builtin vs. a closure, please? For instance: > typeof(sqrt) [1] "builtin" > typeof(mean) [1] "closure" > Thanks, Edna Bell
2019 Aug 13
1
Re: [PATCH libnbd 4/6] lib: Check Closure parameter is not NULL.
On 8/13/19 5:06 AM, Richard W.M. Jones wrote: > This was not permitted by the API before, but would in some > circumstances work. > --- > generator/generator | 10 ++++++++++ > 1 file changed, 10 insertions(+) > Requires nbd_pread_structured and nbd_block_status to pass in a callback (good). Requires nbd_set_debug_callback to provide a non-NULL pointer (a bit rough, as now
2019 Jul 24
2
Re: [PATCH libnbd 2/3] lib: Implement closure lifetimes.
On 7/24/19 7:17 AM, Richard W.M. Jones wrote: > Previously closures had a crude flag which tells if they are > persistent or transient. Transient closures (flag = false) last for > the lifetime of the currently called libnbd function. Persistent > closures had an indefinite lifetime which could last for as long as > the handle. In language bindings handling persistent closures
2011 Jul 25
2
Simple example of using a closure in R to manage bank accounts?
Greetings. I once ran across a simple (toy) example of using a closure in R to manage bank accounts. I've got a use for it now but can no longer find it. If you have it (or a similar example), will you please send it to me? (Unfortunately, a web search that includes the terms "bank" and "closure" leads into a whole pile of unrelated stuff.) Thanks, -- Mike
2012 Jul 26
1
loop for, error: obj type 'closure' not subsetable
Hi everyone, I've got the following problem: I've got a matrix [1000,2] and two vectors. In very matrix row there is two coefficients b0 and b1. The vectors are two variables x and y. I want to do a loop to take b0 and b1 and with x and y calculate the residual of a linear model and calculate the second order coefficient of autocorrelation. What I did is : rho<-function(mat, x,y){
2011 Feb 07
2
as.list(subclassed function) -> cannot coerce type 'closure' to vector of type 'list'
I was looking for all the glm-related 'family' functions in stats using the following predicate that returns TRUE for any function whose first argument is called "link". is.family <- function(object) is.function(object) && identical(names(as.list(object))[1], "link") It threw an error when applied to SSfol > is.family(SSfol) Error in
2010 Jan 14
1
Error: object of type 'closure' is not subsettable
Hi everyone, Would somebody please explain (or point me to a reference that explains) the following error: "Error: object of type 'closure' is not subsettable" I was trying to use rep() to replicate a function: > example_function <- function() { return(TRUE) } > rep(example_function, 3) Error: object of type 'closure' is not subsettable But I just cannot
2019 Aug 09
1
Re: [PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
On 8/9/19 7:59 AM, Richard W.M. Jones wrote: > If we accept that callbacks will never handle the full range of > parameters then we can simplify the generator quite a bit by using a > special type for closure args vs normal method args. Nice. > > This removes many asserts and quite a bit of unreachable code > (eg. Python code for handling ArrayAndLen in normal methods that was
2009 Dec 20
3
Object of type 'closure' not subsettable
Hi all, How can I overcome the error "object of type 'closure' not subsettable" I ran the following script seq <- paste(seq(1914, 1916, by=1), "*.y", sep=".") # make sequence c <- 3 # total number of files d2 <- file # creates dummy file # Input sequence in loop for (i in 1:3){ list <- list.files("~/ukcp09/txt/x.djf", seq[[i]]) file
2011 Apr 09
2
best practice(s) for retrieving a local variable from a closure
Greetings, Say I have defined mp <- function(a) function(x) x^a f2 <- mp(2) and I would like to retrieve the "a" which is local to f2. Two options come to mind; get("a", envir=environment(f2)) eval(substitute(a), environment(f2)) I'm curious if one of these is preferred over the other in terms of efficiency, robustness, aesthetics, etc. Or perhaps
2015 Nov 21
2
Contact-closure UPS
>On Nov 20, 2015, at 12:17 PM, R?bert SZAKSZ <robert at szaksz.eu> wrote: >> >> No progress has been made: >> >> cable is UPS - PC >> 6 - 3 >> 7 - 5 >> 9 - 2 >> > >Maybe pins 4 and 7 (ground) both need to be connected on the UPS side? I connected both to pin 5 >Unfortunately, I don't think there is a safe way (in software)
2008 Dec 28
3
[LLVMdev] Efficient implementation of closures?
A somewhat random question: I'm wondering if there's any kind of trick in LLVM that would allow me to implement closures efficiently. We can assume that a closure function has a hidden parameter which points to its environment, that is, the values of the variables which were in scope at the point where the closure function was defined. The problem comes when mixing closure and
2013 Mar 14
1
error: object of type 'closure' is not subsettable
Hi all, when i run this script: >read.table("Angelika.txt",header=T,sep="\t") >mytable=read.table("Angelika.txt",header=T,sep="\t") >for ( dye in c("A","B","C","F","G","K","L","M")) + { + for (cond in 1:8) + { + measurement =
2011 Aug 18
3
Error message: object of type 'closure' is not subsettable
Dear R-users I need to calibrate kappa, rho, eta, theta, v0 in the following code, see below. However when I run it, I get: y <- function(kappahat, rhohat, etahat, thetahat, v0hat) {sum(difference(k, t, S0, X, r, implvol, q, kappahat, rhohat, etahat, thetahat, v0hat)^2)} > nlminb(start=list(kappa, rho, eta, theta, v0), objective = y, lower =lb, > upper =ub) Error in dots[[1L]][[1L]] :
2010 Dec 01
1
attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'
Hi Dimtris and esteemed useRs, I don't understand why i get this error message when attempting to use merge() - > temp <- merge(x, y[,17, drop=FALSE], by=rownames, sort=FALSE) Error in as.vector(x, mode) : cannot coerce type 'closure' to vector of type 'any' It should work because: > all(rownames(x[order(rownames(x)),]) == + rownames(y[order(rownames(y[,17,
2013 Feb 24
1
Error in J[time] : invalid subscript type 'closure'
Hi All I have Googled the message Error in J[time] : invalid subscript type 'closure', but can't quite make sense from the results that I get. What does it mean? I'm trying to access an element in an array. Here is a short bit of code that produces the error: s_fun <- function(parms,time) { with(as.list(c(parms)),{ print(J[time]) }) } times = seq(from=0, to=100, by =
2010 Mar 19
1
Sweave and " object of type 'closure' is not subsettable" error
Hello folks: I have a data frame which includes two numeric vectors: "Pa1" and "Ingr" (which represents income).  I run the following code on the R console: ingreso <- factor(ifelse(Ingr<=3000,"bajo","alto")) tapply(Pa1,ingreso,summary) boxplot(Pa1~ingreso) and it works fine.  However, when I "Sweave" through an rnw file containing that