similar to: Unexpected behavior of identical() with language objects

Displaying 20 results from an estimated 8000 matches similar to: "Unexpected behavior of identical() with language objects"

2017 Apr 18
2
system/system2 and open file descriptors
It seems that the system() and system2() functions don't close file descriptors between the fork() and exec() (on Unix platforms, of course). This means that the child processes inherit open files and socket connections. Running this (from a terminal) will result in the child process writing to a file that was opened by R: R f <- file('foo.txt', 'w') system('echo
2015 Apr 29
2
R CMD check and missing imports from base packages
On Wed, Apr 29, 2015 at 12:53 PM, Winston Chang <winstonchang1 at gmail.com> wrote: > On Tue, Apr 28, 2015 at 3:04 PM, G?bor Cs?rdi <csardi.gabor at gmail.com> > wrote: > > > > > > E.g. if package 'ggplot2' uses 'stats::density()', and package 'igraph' > > also defines 'density()', and 'igraph' is on the search
2015 Jan 26
2
speedbump in library
>>>>> Winston Chang <winstonchang1 at gmail.com> >>>>> on Fri, 23 Jan 2015 10:15:53 -0600 writes: > I think you can simplify a little by replacing this: > pkg %in% loadedNamespaces() > with this: > .getNamespace(pkg) almost: It would be !is.null(.getNamespace(pkg)) > Whereas getNamespace(pkg) will load the
2015 Jan 22
3
speedbump in library
Hi all, Profiling turned up a bit of a speedbump in the library function. I submitted a patch to the R bug tracker as bug 16168 and I've also included it below. The alternate code is simpler and easier to read/maintain, I believe. Any thoughts on other ways to write this? Index: src/library/base/R/library.R =================================================================== ---
2013 Oct 16
1
Internally accessing ref class methods with .self$x is different from .self[['x']]
When a reference class method is accessed with .self$x, it has different behavior from .self[['x']]. The former copies the function to the object's environment (with some attributes attached), and the latter just return NULL (unless it has already been accessed once with .self$x). Is this how it's supposed to work? Here's an example that illustrates:
2017 Apr 05
6
Very hard to reproduce bug (?) in R-devel
) On Wed, Apr 5, 2017 at 2:59 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > > >>>>> Winston Chang <winstonchang1 at gmail.com> > >>>>> on Tue, 4 Apr 2017 15:29:40 -0500 writes: > > > I've done some more investigation into the problem, and it is very > > difficult to pin down. What it looks like is
2015 Jan 26
2
speedbump in library
>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>> on Mon, 26 Jan 2015 05:12:55 -0800 writes: > A isNamespaceLoaded() function would be a useful thing to > have in general if we are interested in readable code. An > efficient implementation would be just a bonus. Good point (readability), and thank you for the support! Note
2017 Apr 04
2
Very hard to reproduce bug (?) in R-devel
> > >> I've done some more investigation into the problem, and it is very difficult to pin down. What it looks like is happening is roughly like this: - `p` is an environment and `p$e` is also an environment. - There is a loop. In each iteration, it looks for one item in `p$e`, saves it in a variable `x`, then removes that item from `p$e`. Then it invokes `x()`. The loop runs
2020 Mar 26
3
Rebuilding and re-checking of downstream dependencies on CRAN Mac build machines
I have two questions about the CRAN machines that build binary packages for Mac. When a new version of a package is released, (A) Do the downstream dependencies get re-checked? (B) Do the downstream dependencies get re-built? I have heard (but do not know for sure) that the answer to (A) is no, the downstream dependencies do not get rechecked. >From publicly available information on the
2014 Aug 11
1
Error when assigning value in environment which is a locked binding
If an environment x contains a locked binding y which is also an environment, and then you try to assign a value to a binding inside of y, it can either succeed or fail, depending on how you refer to environment y. x <- new.env() x$y <- new.env() lockEnvironment(x, bindings = TRUE) # This assignment fails x$y$z <- 1 # Error in x$y$z <- 1 : cannot change value of locked binding for
2014 Jun 17
2
R CMD check warning with S3 method
I'm getting an R CMD check warning with a package (call it package A) that defines an S3 method but not the generic. The generic is defined in another package (package B). Package A imports the S3 generic from B. And there's one additional detail: the generic overrides a function in the stats package. I've created a minimal test package which reproduces the problem:
2007 Feb 02
7
Coming Soon...
Dear spec''ers, As many of you already know, we''re gearing up for a pretty big 0.8 release of RSpec in the next couple of weeks. I''m writing in advance because I want to give you a heads up about upcoming changes and how they may impact your existing specs. Two important things to note first: 1. We will provide a translator that you''ll be able to use to
2016 Jun 22
1
dowload.file(method="libcurl") and GET vs. HEAD requests
Thanks for looking into it. Is there a way to avoid the HEAD request in R 3.3.0? I'm asking because if there isn't, then I'll add a workaround in a package I'm working on. -Winston On Tue, Jun 21, 2016 at 9:45 PM, Martin Morgan <martin.morgan at roswellpark.org> wrote: > On 06/21/2016 09:35 PM, Winston Chang wrote: >> >> In R 3.2.4, if you ran
2013 Dec 19
2
Strange warnings when unloading packages with S4 classes
I've been seeing warnings when unloading packages. They can be seen with the shiny and sp packages, among others (this is on R 3.0.2). For example: > library(sp) > unloadNamespace('sp') Warning messages: 1: In FUN(X[[2L]], ...) : Created a package name, ‘2013-12-19 12:14:24’, when none found 2: In FUN(X[[2L]], ...) : Created a package name, ‘2013-12-19 12:14:24’, when none
2014 Dec 03
2
we need an exists/get hybrid
Thanks Winston! I'm amazed that "[[" beats calling the .Internal directly. I guess the difference between .Primitive vs. .Internal is pretty significant for things on this time scale. NULL meaning NULL and NULL meaning undefined would lead to the same path for much of my code. I'll be swapping out many exists and get calls later today. Thanks! I do still think it would be
2017 Apr 03
3
Very hard to reproduce bug (?) in R-devel
When running R CMD check on a package, we are encountering an error on R-devel (as of 72457) on Linux. Unfortunately, it is very hard to reproduce, and almost any change to the code makes the error go away. I believe that this is due to a bug in R-devel, which has been present since at least commit 72128 (on 2017-02-06). The test error occurs when R CMD check is run on Travis CI (on Ubuntu
2012 Jun 14
2
"Incompatible methods" for overloaded operator
I'm trying to overload an operator, and I'm running into a strange problem. It happens when I install and load the package, but not when I simply source() the code. I'm defining + for two classes. The R code looks like this: #' @export #' @method "+" a `+.a` <- function (x1, x2) { message("Running custom + function") } #' @export #' @method
2012 Jul 24
1
Finding dynamic shared libraries loaded with a package
Is there a way to query a package to see what dynamic shared libraries are loaded with it? The reason I ask is because during development, I want to unload libraries so that they can be reloaded without restarting R. I want to make it automatic so that you can just pass in the name of the package, and it will unload all the relevant shared libraries. Typically, the name of the shared library is
2015 Jan 08
4
unloadNamespace
In the documentation the closed thing I see to an explanation of this is that ?detach says "Unloading some namespaces has undesirable side effects" Can anyone explain why unloading tseries will load zoo? I don't think this behavior is specific to tseries, it's just an example. I realize one would not usually unload something that is not loaded, but I would expect it to do
2015 Apr 29
4
R CMD check and missing imports from base packages
On Wed, Apr 29, 2015 at 1:45 PM, Gabriel Becker <gmbecker at ucdavis.edu> wrote: > Gabor, > > To play devil's advocate a bit, why not just have the package formally > import the functions it wants to use (or the whole package if that is > easier)? > This is exactly my goal. And to facilitate this, R CMD check could remind you if you forgot to do the formal import.