search for: lockbinding

Displaying 20 results from an estimated 21 matches for "lockbinding".

Did you mean: unlockbinding
2009 Jan 23
1
overwriting '<-' and infinite recursions
...need to overwrite it is complicated and not easy to tell in a few words; but this seems the only clean option other than hacking R's core source code. My code looks like: # in .onLoad of a package; or if you want to test, put it in a function env <- as.environment('package:base') unlockBinding('<-',env) assign('<-', newAssign, envir=env) .Internal(lockBinding(as.name('<-'), env)) #not using lockBinding directly because it calls '<-' It gave me this error: Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Any su...
2008 Mar 13
3
Sealed for setGeneric
Hi the list When two setGeneric occurs on the same function, the second erage the first and erase all the function previously define. Is it possible to prevent that ? Is it possible to declare a setGeneric that can not be erased later ? Something like the |sealed for setMethod...| || |Thanks| || Christophe
2009 Sep 16
4
vhost-net todo list
Some people asked about getting involved with vhost. Here's a short list of projects. vhost-net driver projects - profiling would be very helpful, I have not done any yet - tap support - working on it now - merged buffers - working on it now - scalability/fairness for large # of guests - working on it now - logging support with dirty page tracking in kernel - working on it now - indirect
2009 Sep 16
4
vhost-net todo list
Some people asked about getting involved with vhost. Here's a short list of projects. vhost-net driver projects - profiling would be very helpful, I have not done any yet - tap support - working on it now - merged buffers - working on it now - scalability/fairness for large # of guests - working on it now - logging support with dirty page tracking in kernel - working on it now - indirect
2002 Apr 14
1
Suggestion for implementation
I wonder if it was possible (and desireable) to implement means to protect data objects (and functions) from overwriting them. So for instance: > x <- 5 > protect(x) > x <- 8 Error: x is read only Or would that be against the philosophy of R to be compatible to S?! Just a RFC ;-) Yours, Christoph. ps. Your probably know the situations that let you think of such a feature
2011 Mar 15
5
Does R have a "const object"?
Hi, all, Does R have a "const object" concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! xiagao1982 2011-03-15 [[alternative HTML version deleted]]
2012 Nov 08
1
Dabbling with R5 setRefClass - Inheritance problems
...fields = list( > RcfpdVersion = "character"), > methods = list( > initialize = function(){ > 'Populates fields with defaults and lock as appropriate' > initFields( > RcfpdVersion = as.character(packageVersion("RCFPD"))) > lockBinding(sym="RcfpdVersion",env=.self) > })) And a second one like this: > sequencesuperclass <- setRefClass( > Class="sequencesuperclass", > fields = list( > test="character"), > contains="rcfpdsuperclass") Executing the latter I ge...
2018 Dec 21
2
Bug report: R.home() cause package Rcpp failed executing sourceCpp, similar bug are labeled "BUG 16660" since 2016 and here I could provide a solution that tested in my laptop.
...) Error in system(cmd, intern = !showOutput) : 'D:/Program' not found Error in system(cmd, ignore.stderr = TRUE, intern = TRUE) : 'D:/Program' not found Code is tested in both R 3.5.1 and Microsoft R Open 3.5.1. I find a temp solution, is to copy such words into Rprofile: unlockBinding("R.home", baseenv()) utils::assignInNamespace("R.home",function (component = "home") { rh <- .Internal(R.home()) paste0('"',switch(component, home = rh, bin = if (.Platform$OS.type == "windows" && nzchar(p <- .Platfo...
2020 Sep 24
1
How to use `[` without evaluating the arguments.
...t to store private metadata for a LongTable internals <- new.env() ## TODO:: Implement error handling internals$rowIDs <- if (is.numeric(rowIDs) && max(rowIDs) < ncol(rowData)) rowIDs else which(colnames(rowData) %in% rowIDs) lockBinding('rowIDs', internals) internals$colIDs <- if (is.numeric(colIDs) && max(colIDs) < ncol(colData)) colIDs else which(colnames(colData) %in% colIDs) lockBinding('colIDs', internals) # Assemble the pseudo row and column...
2011 Jan 26
1
Problem with "setMethod" in R package
...othC>("rothC") .constructor() ... } ######### FILE rcpp_rothC.R ######### Rcpp_rothC.plot <- function(x,y,...) { ... } ########## FILE zzz.R ########## .NAMESPACE <- environment() rothC <- new( "Module" ) .onLoad <- function(libname, pkgname) { unlockBinding( "rothC" , .NAMESPACE ) assign( "rothC", Module( "rothC" ), .NAMESPACE ) setMethod(f="plot",signature(x="Rcpp_rothC",y="missing"),definition=Rcpp_rothC.plot,where=.GlobalEnv); lockBinding( "rothC", .NAMESPACE ) } .onAtt...
2024 Mar 21
1
[External] Re: Building Packages. (fwd)
...ible. You can fix all of these with something like local({ up <- match("package:utils", search()) detach("package:utils") library(utils, pos = up) }) or just install.packages with local({ up <- match("package:utils", search()) unlockBinding("install.packages", pos.to.env(up)) assign("install.packages", utils::install.packages, "package:utils") lockBinding("install.packages", pos.to.env(up)) }) Best, luke On Thu, 21 Mar 2024, Duncan Murdoch wrote: > Yes, you're right. The ve...
2009 Oct 04
1
Modify base R functions in Rprofile.site
Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: parse=function(...){ base::parse(...) } I'll get an error when I start R as follows: Error: cannot change value of locked binding for
2010 Jan 24
1
header files for R packages
I have 6 or 7 nice constants (for example 1852 meters per nautical mile) I would like to have available to 4 or 5 functions in an R package. In C this would just be a header .h file and I would just "include" I am stuck trying to figure out how to create something like a C header file for an R package. Any ideas?
2011 Jan 23
0
setMethod call in package code using Rcpp
...othC>("rothC") .constructor() ... } ######### FILE rcpp_rothC.R ######### Rcpp_rothC.plot <- function(x,y,...) { ... } ########## FILE zzz.R ########## .NAMESPACE <- environment() rothC <- new( "Module" ) .onLoad <- function(libname, pkgname) { unlockBinding( "rothC" , .NAMESPACE ) assign( "rothC", Module( "rothC" ), .NAMESPACE ) setMethod(f="plot",signature(x="Rcpp_rothC",y="missing"),definition=Rcpp_rothC.plot,where=.GlobalEnv); lockBinding( "rothC", .NAMESPACE ) } .onAtt...
2006 May 14
1
bindingIsLocked returns illogical logical
bindingIsLocked applied to a locked binding returns a 'logical' that is niether true nor false. Martin > e <- new.env() > e$x <- 1 > e$y <- 2 > lockBinding("x", e) NULL > bindingIsLocked("x", e) [1] TRUE > bindingIsLocked("x", e)==TRUE [1] FALSE > bindingIsLocked("x", e)==FALSE [1] FALSE > bindingIsLocked("y", e) [1] FALSE > bindingIsLocked("y", e)==FALSE [1] TRUE > bindingI...
2013 Feb 27
0
How to specify ff object filepaths when reading a CSV file into a ff data frame.
...} else { do.call("as.ff", c(list(xi, vmode = vmodes[[i]]), col_args)) } }, ...) names(ret) <- names(x) do.call("ffdf", c(ret, list(row.names = rnam), l)) } # |||||||||||||||||||||||||||||||| hook ||||||||||||||||||||||||||||||||| library(methods) unlockBinding("as.ffdf.data.frame", as.environment("package:ff")) assignInNamespace("as.ffdf.data.frame", my.as.ffdf.data.frame, ns="ff", envir=as.environment("package:ff")) assign("as.ffdf.data.frame", my.as.ffdf.data....
2012 Jun 19
1
Reference classes and memory consumption
Dear All, It seems that reference classes consume a lot of memory which became a problem for my rather extensive simulation. I prepared a small example. An instance of this minimal class uses about 20K on disk. rm(list=ls(all=TRUE)); MySmallClass = setRefClass("MySmallClass", fields = list( myField = "numeric" ), methods = list( initialize =
2024 Mar 21
1
[External] Re: Building Packages. (fwd)
...cal({ > up <- match("package:utils", search()) > detach("package:utils") > library(utils, pos = up) > }) > > or just install.packages with > > local({ > up <- match("package:utils", search()) > unlockBinding("install.packages", pos.to.env(up)) > assign("install.packages", utils::install.packages, "package:utils") > lockBinding("install.packages", pos.to.env(up)) > }) > > Best, > > luke > > On Thu, 21 Mar 2024, Duncan Murd...
2010 May 29
3
S4 dispatch for .DollarNames (utils)
Hello, I'm trying to make .DollarNames generic and implement a method for it in a package. .DollarNames is the function that is now called to get completion possibilities. My R code looks like this: setGeneric( ".DollarNames" ) setClass("track", representation(x="numeric", y="numeric")) ## A class extending the previous, adding one more
2008 Oct 20
2
R 2.8.0 is released
.... o is.unsorted() gains an argument 'strictly'. It now works for classed objects with a >= or > method (as incorrectly documented earlier). o library() no longer warns about the masking objects that are identical(.,.) to those they mask. o lockBinding(), unlockBinding(), lockEnvironment() and makeActiveBinding() now all return invisibly (they always return NULL). o mood.test() now behaves better in the presence of ties. o na.action() now works on fits of classes "lm", "glm", .... o optim(....