similar to: developing a package with a name space

Displaying 20 results from an estimated 10000 matches similar to: "developing a package with a name space"

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
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")
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
2005 Apr 28
1
strange behaviour of importFrom directive in name space
Dear listers, After activating the name space for my bioconductor package (prada) I successfully ran R CMD check. However when loading the package in R and running the examples the imported function brewer.pal from package RColorBrewer is not found. I can directly call brewer.pal from the RColorBrewer name space typing RColorBrewer::brewer.pal, but it is not imported into my prada name space. When
2005 Apr 28
1
strange behaviour of importFrom directive in name space
Dear listers, After activating the name space for my bioconductor package (prada) I successfully ran R CMD check. However when loading the package in R and running the examples the imported function brewer.pal from package RColorBrewer is not found. I can directly call brewer.pal from the RColorBrewer name space typing RColorBrewer::brewer.pal, but it is not imported into my prada name space. When
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
2013 Feb 04
2
developing package: dealing with namespaces
I am tweaking an R package for which I have the source; the relevant code is in R not C. I'm making changes to the package code. What is the best workflow for doing this? I recall the advice used to be to remove the NAMESPACE during development, but I don't think this is possible anymore. For simplicity, suppose I have an outer level function f defined in f.R and an innder g in g.R
2008 Jul 02
1
Hmisc latex function with longtable option
Hello - I'm trying to use Hmisc's latex function to produce a postscript file of a data.frame, using the longtable = TRUE option. When I run, for example, ## sample R code dvips(latex(data.frame(a = rnorm(100), b = rnorm(100)), longtable = TRUE), file = "test.ps") latex runs successfully and a test.ps file is produced. However, I see the following in the
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 May 16
2
Integer / floating point question
Dear R-help - I have thought about this question for a bit, and come up with no satisfactory answer. Say I have the numeric vector t1, given as t1 <- c(1.0, 1.5, 2.0, 2.5, 3.0) I simply want to reliably extract the unique integers from t1, i.e., the vector c(1, 2, 3). This is of course superficially simple to carry out. However, my question is related to R FAQ 7.31, "Why
2012 Jul 30
1
locked binding of setwd() in R 2.15.x causes .Rprofile to fail
[Env: Win XP, R 2.14.2, R 2.15.0] I have a replacement function for setwd() in my .Rprofile which displays the current R path in the R window title. It no longer works in R 2.15.x, giving the error below. Worse, the error prevents the rest of my .Rprofile script from completing. Is there some way to rescue this, i.e., preserve this behavior in R 2.15? If not, how can I modify my script so it
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",
2007 Nov 08
2
mapply, coxph, and model formula
Hello - I am wanting to create some Cox PH models with coxph (in package survival) using different datasets. The code below illustrates my current approach and problem with completing this. ### BEGIN R SAMPLE CODE ############################## library(survival) #Define a function to make test data makeTestDF <- function(n) { times <- sample(1:200, n, replace = TRUE) event
2011 Jul 07
0
Developing with Namespaces (was: Recent and upcoming changes to R-devel)
Hi Kasper FWIW, the package development and maintenance support in 'mvbutils' makes it trivial to work with namespaced packages, even at the earliest stages of development. It's completely easy to add and remove functions to/from the namespace (and the exported visible bit) while the package is loaded. Debugging is seamless (via the 'debug' package, anyway). There is no need
2007 Apr 23
2
Documentation for namespaces
Brian Ripley recently replied to a comment of mine by referring to a function 'assignInNamespace', which I had not heard of. Is there a good write up on name spaces in R? There are little tidbits in the manuals on the R site, but I found nothing substative. I'd like to understand these better. Terry Therneau
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 Jan 01
1
Wireless network connection problem
hi all , i just met a strange problem about my wireless network , i installed ipw3945 driver and it can detect the wireless network lists around my laptop ,but , i can't connect to the wireless network even under the right authority my centos 5.2 dectected my wirless network card as eth1 , it's really strange , i think any help ? thx and wish you a happy new year :) -- Keep It Simple
2006 Apr 04
1
Indexing a vector by a list of vectors
Hello R-help - I have vec <- c("string1", "string2", "string3") ind <- list(c(1,2),c(1,2,3)) I want "vec" indexed by each vector in the list "ind". The first element of the list I want would be vec[c(1,2)], the second element would be vec[c(1,2,3)], like the following. [[1]] [1] "string1" "string2" [[2]] [1]
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
2005 Dec 29
1
'last.warning' problem at startup; package Matrix (PR#8453)
On starting an R session, I get the messages: Fatal errir: unable to restore save data in .RData Error in fun(...): couldn't find function "assignInNamespace" Error: .onLoad failed in 'loadNamespace' for 'Matrix' The only object in my .RData is last.warning, thus: > last.warning $"optim or nlminb returned message false convergence (8)"