Displaying 20 results from an estimated 5000 matches similar to: "overwriting '<-' and infinite recursions"
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) :
2011 Jan 26
1
Problem with "setMethod" in R package
Dear all,
My apologies for re-posting this question, but I have not found any
solution to my problem so far. I also think that my post may have been
overseen due to the posting time and high traffic on this list.
I experience a problem in implementing a S4 class in a package and would
appreciate your help in this matter.
The class is implemented using Rcpp, which works well. I then extend
2011 Aug 08
1
Overwriting imported function in another package
I am running into a limitation of the grid::grid.newpage function, for
which I would like to overwrite this function with a slightly modified
one. Hopefully this is a temporary working solution until the package
gets updated. I found a way to overwrite the function in the
package:grid namespace. However, lattice imports grid rather than
depending on it. So I need a way to overwrite this imported
2024 Mar 21
1
[External] Re: Building Packages. (fwd)
[forgot to copy to R-help so re-sending]
---------- Forwarded message ----------
Date: Thu, 21 Mar 2024 11:41:52 +0000
From: luke-tierney at uiowa.edu
To: Duncan Murdoch <murdoch.duncan at gmail.com>
Subject: Re: [External] Re: [R] Building Packages.
At least on my installed version (which tells me it is out of date)
they appear to just be modifying the "package:utils" parent
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
2024 Mar 21
1
[External] Re: Building Packages. (fwd)
If you are wondering why RStudio did this, you can see their substitute
function using
(parent.env(environment(install.packages)))$hook
They appear to do these things:
- Allow package installation to be disabled.
- Check if a package to be installed is already loaded, so that
RStudio can restart R for the install.
- Add Rtools to the PATH if necessary.
- Trigger an event to say
2011 Jan 23
0
setMethod call in package code using Rcpp
Dear all,
I experience a problem in implementing a S4 class in a package and would
appreciate your help in this matter.
The class is implemented using Rcpp, which works well. I then extend the
class with R functions, adding them as methods with a call to
setMethod(...). When I do this outside the package (after loading the
package with "library(...)"), everything works smoothly.
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
2011 May 31
1
assignInNamespace and new bindings
Hello,
assignInNamespace refuses to assign an object to a name that is not
already used in the namespace.
Something like this would make it possible:
--- src/library/utils/R/objects.R (revision 56024)
+++ src/library/utils/R/objects.R (working copy)
@@ -252,8 +252,9 @@
stop("environment specified is not a package")
ns <- asNamespace(substring(nm, 9L))
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
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
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
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]]
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 Jan 22
3
how to get a primitive function object
Hi,
I want to create an alias for the "<-" function and then later
overwrite it. Any idea how I can get the "<-" function object? I know
for other functions it's easy, something like "f <- seq" will do; how
really no clue for this one. Thanks!
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
2012 Nov 08
1
Dabbling with R5 setRefClass - Inheritance problems
Hello,
I wrote a class like so:
> rcfdpsuperclass <- setRefClass(
> Class="rcfdpsuperclass",
> fields = list(
> RcfpdVersion = "character"),
> methods = list(
> initialize = function(){
> 'Populates fields with defaults and lock as appropriate'
> initFields(
> RcfpdVersion =
2015 Jan 21
2
reducing redundant work in methods package
Hi all,
The function call series genericForPrimitive -> .findBasicFuns -> .findAll
happens 4400 times while the GenomicRanges package is loading. Each time
.findAll follows a chain of environments to determine that the methods
namespace is the only one that holds a variable called .BasicFunsList. This
accounts for ~10% of package loading time. I'm sure there is some history
to that
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