similar to: Modify functions in base packages (needed for completion for proto objects)

Displaying 20 results from an estimated 3000 matches similar to: "Modify functions in base packages (needed for completion for proto objects)"

2009 Aug 17
2
S4: inheritance of validity methods?
Dear Developers, In current implementation of validity method, objects are first coerced to superclass (slots are striped). Thus, it is not possible to write validity method which would perform some checks on children slots. Say, I want to check if number of slots in a class is equal to "n": setClass("A", representation(a="numeric", n="integer"),
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))
2008 Dec 02
4
Bug in "transform"?
Dear useRs, Here is a weird behavior of transform function: mtcars1<-matcars transform(mtcars1,t1=3,t2=4) Error in data.frame(`_data`, e[!matched]) : arguments imply differing number of rows: 32, 1 instead, this works: mtcars1$t1<-0 transform(mtcars1,t1=3,t2=4) also works if applied in turn: transform(mtcars1,t1=3) transform(mtcars1,t2=4) I often need to use this
2009 Oct 15
2
forwarded: bug (?) in cut.POSIXt with "breaks"=integer
From: Vitalie S. <vitosmail <at> rambler.ru> Subject: Bug in cut.POSIXt Newsgroups: gmane.comp.lang.r.general Date: 2009-10-15 15:47:48 GMT (1 hour and 29 minutes ago) Hello Everyone, Before reporting decided to post here first: tt <- structure(c(1254238817, 1254238859, 1254238969, 1254239080), class = c("POSIXt",
2009 Aug 28
1
names<- in data.frame (PR#13916)
Full_Name: Spinu Vitalie Version: 2.9.0 OS: Windows Submission from: (NULL) (130.115.113.15) In assignment of "zero length" names to data.frame: > tdf <- data.frame(rbind(c(1, 2), c(1, 2))) > names(tdf) <- c("", "") > tdf structure(c("1", "1"), class = "AsIs") structure(c("2", "2"), class =
2009 Mar 31
4
what is the preferred method to create a package local variable?
for the moment, I'm using: .onAttach <- function(libname, pkgname) { .bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah") } .onUnload <- function(libpath) { dbDisconnect(.bbg.db.conn) } which results in a hidden global variable in the global environment. I would prefer to make the assignment only in the package namespace.
2009 Jun 05
2
S4: When is validObject issued? (or why S4 is killing me:( ..
Dear UseRs, Does anyone know when exactly the validity is checked in S4? Documentation is silent:(. Here is a small example: setClass("test1",representation(a="numeric")) setMethod("initialize","test1", function(.Object,...){ a<-runif(1) ## here slot "a" is initialized ## callNextMethod(.Object,a=a,...)
2008 Jun 14
1
How to see data for a package built under Windows
I have followed the instructions on how to build a Windows package and everything seems to work EXCEPT that I can't see the data files that I have loaded into the data directory. I have placed the appropriate data in the data directory (as in the instructions). There are 3 data sets, which I can see when I use the command in R. Details below. I have searched everywhere to try to fix this, but
2011 Jun 23
1
Class not found when search in .onLoad
Hi, I am facing with a strange behaviour of isClass and extends when these are called in .onLoad in both R 2.12.1 and R 2.13.0. This is preventing my package from doing some object initializations at a proper place (i.e. in .onLoad). Suppose one defines two S4 classes in a package, and that one needs to check the inheritance between these two when loading the package (e.g. to validate slots
2012 Apr 05
1
issue with base:::namespaceImportMethods
Hi, I've noticed an issue with S4 methods and namespaces which only arises in particular, difficult to reproduce configurations. One example is the ggbio package in Bioconductor, which currently emits these warnings when its namespace is loaded: ---------------------- library(ggbio) Loading required package: ggplot2 Attaching package: ‘ggbio’ The following object(s) are masked from
2012 Mar 14
1
[ESS] completion in [] (R internal completion fails)
Hello, I am forwarding this from ESS mailing list, as it's a failure of internal R completion system: This fails: utils:::.assignLinebuffer('iris[iris$Spec') utils:::.assignEnd(15) utils:::.guessTokenFromLine() utils:::.completeToken() utils:::.retrieveCompletions() ## -> [1] "iris[iris$Spec" This works utils:::.assignLinebuffer('iris[ iris$Spec') # note the
2007 May 15
1
getNamespaceExports("base") error
Hi! >getNamespaceExports("base") Error in ls(NULL, all = TRUE) : using 'as.environment(NULL)' is defunct getNamespaceExports function (ns) { ns <- asNamespace(ns) if (isBaseNamespace(ns)) ls(NULL, all = TRUE) else ls(getNamespaceInfo(ns, "exports"), all = TRUE) } <environment: namespace:base> One possible way to fix this could be
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
2015 Jan 21
2
reducing redundant work in methods package
Doing it like this: genericForPrimitive <- function(f, where = topenv(parent.frame()), mustFind = TRUE) { ans = .BasicFunsList[[f]] ## this element may not exist (yet, during loading), dom't test null if(mustFind && identical(ans, FALSE)) stop(gettextf("methods may not be defined for primitive function %s in this version of R",
2010 Oct 11
2
Trouble accessing cov function from stats library
Dear all I am trying to use the cov function in the stats library. I have no problem using this function from the console. However, in my R script I received a "function not found" message. Then I called stats::cov(...) and received an error message that the function was not exported. Then I tried stats:::cov (three colons) and received the error Error in get(name, envir =
2017 Feb 27
5
Test suite failures in R-devel_2017-02-25_r72256
Hi, I tried compiling the latest pre-release for R 3.3.3 for the NixOS Linux distribution [1], but the build fails during the "make check" phase because of the following 2 issues: 1) The "tools" test in "tests/Examples" requires network access, which it doesn't have in our build environment. Therefore, it fails as follows according to
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
Consider: x <- list(`a b` = 1) x$a<tab> (i.e., press the 'tab' key after typing 'x$a') The auto-complete mechanism will fill the buffer like so: x$a b This is not particularly helpful because this is now a syntax error. It seems to me there's a simple fix -- in utils:::specialCompletions(), we can wrap the result of utils:::specialOpCompletionsHelper() with
2010 Oct 24
2
"$<-" fails (invalid subscript type 'language')
This might be just beyond of my understanding of how assignment works in R, but the documentation does not say anything about: > tv <- c(a="dsf", b="sss") > tl <- list(232) > `$<-`(tl, tv[[1]], "sdfdsfdsfsd") Error: invalid subscript type 'language' This happens even before the method is dispatched. I can not handle the "name"
2016 May 20
2
identical on closures
I'm confused by this: > identical(function() {}, function() {}) [1] FALSE Yet, after loading the Matrix package (which redefines det), the following is checked (in library.checkConflicts): > identical(get("det", baseenv()), get("det", asNamespace("Matrix")), ignore.environment=T) [1] TRUE I've looked at the code in identical.c and for closures it
2012 Mar 21
2
enableJIT() prohibits usual R debugging
Hi, Browser doesn't work properly with the compiler enabled. It might be intended behavior, but it's not documented. compiler::enableJIT(1) foo <- function(){ browser() cat("here\n") } Browser doesn't stop, and I am getting: > foo() Called from: foo() Browse[1]> here > Thanks, Vitalie. > sessionInfo() R version 2.14.2 (2012-02-29) Platform: