similar to: assignInNamespace and new bindings

Displaying 20 results from an estimated 200 matches similar to: "assignInNamespace and new bindings"

2011 May 26
1
serialization of external pointers
Hello, I'm looking for examples of how to handle serialization of external pointers. We use external pointers intensively in Rcpp for modules and one popular request is to have persistence. And I guess we need to be able to serialize/deserialize external pointers for this. Also, module objects are all instances of reference classes, so maybe that can be handled at the R level ? Romain
2011 Jun 04
2
Interfacing a C++ class
Hello Apologies for cross-posting, the discussion should (if) go to R-devel, but I also want to reach the rcpp-devel people. My C++ class FOO is a module available through Rcpp, and it works fine and is -- so far -- bug free. With trying to further develop my R package, I thought it was a good idea to interface my C++ workhorse FOO with an S4 class Foo. After some long and not always insightful
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 >
2013 Feb 07
1
assignInNamespace to create a setwd() replacement: how to use unlockBinding()?
In my .Rprofile for Windows, I had the following functions defined to mirror a few features I miss from linux: (a) replace setwd() with a version that stashes the current directory so it can be easily restored (b) writes a short version of the current R directory to the Windows title bar: I can always see where I am, with multiple Rgui windows. (c) creates a cd() shorthand for setwd(), but
2004 May 13
0
using trace() on S4 coerce method
I'm trying to use trace() on an S4 coerce method, but get the error Error in bindingIsLocked(what, whereM) : no binding for "coerce" What am I doing wrong? Example code follows. (I've googled the R mailing lists for "trace coerce" and "trace bindingisLocked" without finding anything relevant. Perhaps I should re-define the method in terms of an
2018 Apr 18
0
odd assignInNamespace / setGeneric interaction
Hi Bill, Ideally, your coworker would just make an alias (or shortcut or whatever) for R that passed --no-save to R. I'll try to look into this though. Michael On Wed, Apr 18, 2018 at 1:38 PM, William Dunlap via R-devel <r-devel at r-project.org> wrote: > A coworker got tired of having to type 'yes' or 'no' after quitting R: he > never wanted to save the R
2006 Feb 06
1
Error in fun(...) : couldn't find function "assignInNamespace"
I started my laptop, opened a shell and get this error message: R : Copyright 2005, The R Foundation for Statistical Computing Version 2.2.1 (2005-12-20 r36812) ISBN 3-900051-07-0 lines deleted Error in fun(...) : couldn't find function "assignInNamespace" Error: .onLoad failed in 'loadNamespace' for 'Matrix' Fatal error: unable to restore saved data in .RData
2018 Apr 19
0
odd assignInNamespace / setGeneric interaction
The problem is not specific to redefining the q function, but to the interaction of assignInNamespace and setGeneric. The latter requires, roughtly, that the environment of the function being replaced by an S4 generic is (or is the descendent of) the environment in which it lives. E.g., the following demonstrates the problem % R --quiet --vanilla > assignInNamespace("plot",
2018 Apr 18
2
odd assignInNamespace / setGeneric interaction
A coworker got tired of having to type 'yes' or 'no' after quitting R: he never wanted to save the R workspace when quitting. So he added assignInNamespace lines to his .Rprofile file to replace base::q with one that, by default, called the original with save="no".. utils::assignInNamespace(".qOrig", base::q, "base")
2018 Apr 19
2
odd assignInNamespace / setGeneric interaction
>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>> on Wed, 18 Apr 2018 14:16:37 -0700 writes: > Hi Bill, > Ideally, your coworker would just make an alias (or shortcut or > whatever) for R that passed --no-save to R. I'll try to look into this > though. > Michael Yes, indeed! As some of you know, I've
2012 Dec 11
1
Reassign functions called by other functions in package graphics
I am trying to get a function written in R that calls a cascade of functions from the graphics package, and I want to eventually call replacements to functions in the graphics package instead of the originals. Specifically, I have a function that calls qqnorm in stats, which calls qqnorm.default in stats, which calls plot in graphics, which calls plot.default and plot.new, and I want my own
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.
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16660 Here is the bug, which R.home may generate a path contains a whitespace. this will cause Rcpp failed executing sourceCpp > sourceCpp("b:/2018-12-14/src/18020/MCMC.cpp") Error in system(cmd, intern = !showOutput) : 'D:/Program' not found Error in system(cmd, ignore.stderr = TRUE, intern = TRUE) :
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
2013 Feb 27
0
How to specify ff object filepaths when reading a CSV file into a ff data frame.
Really old subject?, so, all my apologizes for digging up but, since I also ran into this? maybe this hack can be useful to someone I propose monkey patching here: library(ff) my.as.ffdf.data.frame <- function (x, vmode = NULL, col_args = list(), ...) { rnam <- attr(x, "row.names") if (is.integer(rnam)) { if (all(rnam == seq_along(rnam))) rnam <- NULL else
2006 Jun 01
0
R 2.3.1 is released
I've rolled up R-2.3.1.tar.gz a short while ago. This version contains several minor fixups and removes a couple of bad bugs. See the full list of changes below. You can get it (in a short while) from http://cran.r-project.org/src/base/R-2/R-2.3.1.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries for various platforms will appear in due course. There is also a
2006 Jun 01
0
R 2.3.1 is released
I've rolled up R-2.3.1.tar.gz a short while ago. This version contains several minor fixups and removes a couple of bad bugs. See the full list of changes below. You can get it (in a short while) from http://cran.r-project.org/src/base/R-2/R-2.3.1.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries for various platforms will appear in due course. There is also a
2006 May 19
1
UseMethod infelicity
If I do > example(lm) ... > mycoef <- function(object, ...) UseMethod("coef", object) > mycoef(lm.D9) Error in mycoef(lm.D9) : no applicable method for "coef" which is pretty surprising, as coef has a default method. After a bit of digging, this comes from do_usemethod having defenv = environment where the generic was defined */ defenv =
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
2009 Apr 20
1
Sharing variables in seperate workspace
Hi all. I'm for the first time trying to make a library in R 2.8.1 on Ubuntu Linux. The library is very simple, R functions just need to share a variable (that is defined in the R code) and maybe functions and export functions for the user to .GlobalEnv. This variable should only be directly accessible from the global workspace (without change of environment) via a hereto dedicated function.
2013 Jul 26
1
How to best implement package options?
Dear developeRs, I have a package, pls, that implements package options. The users are supposed to use a function pls.options() to manipulate them. If a user changes the options, they are stored in .GlobalEnv. I was recently informed that this is against current CRAN submission policies, so I need to change that. I have looked at several different packages that implement package options, and