search for: onattach

Displaying 20 results from an estimated 109 matches for "onattach".

2006 Apr 13
1
Wishlist: 'quietly' argument for .onAttach() / .First.li b()
From: Prof Brian Ripley > > On Thu, 13 Apr 2006, Peter Ruckdeschel wrote: > > > Hi R-devels, > > > > in "Writing R extensions" as well as in the help > > to .onAttach(), you mention that one could > > use this function to issue a start-up message/banner > > for the package. > > > > My little wish for Easter: > > > > a 'quietly'-type argument for .onAttach() / .First.lib() which is > > passed through by functions...
2011 Jun 23
1
Class not found when search in .onLoad
...age (e.g. to validate slots in objects). See package attached or code below (not sure attachments can go through). in R 2.13.0: At the loading check after installation, the classes are not found by `isClass` and `extends` when these are called in .onLoad, but are correctly found when called in .onAttach. However findClass correctly finds the class in both case, as well as isClass if it is called with the argument `where=asNamespace('<THE.PACKAGE.NAME>')`. When the package is loaded from an open R session, the behaviour is the same. in R 2.12.1: the classes are correctly found by...
2006 Apr 13
4
Wishlist: 'quietly' argument for .onAttach() / .First.lib()
Hi R-devels, in "Writing R extensions" as well as in the help to .onAttach(), you mention that one could use this function to issue a start-up message/banner for the package. My little wish for Easter: a 'quietly'-type argument for .onAttach() / .First.lib() which is passed through by functions require() and library() respectively, and by means of which one coul...
2005 Aug 27
2
Writing R-extensions
...Load hooks' states Packages with name spaces do not use the @code{.First.lib} function. Since loading and attaching are distinct operations when a name space is used, separate hooks are provided for each. These hook functions are called @code{.onLoad} and @code{.onAttach}. I interpreted this as "o.k., loading and attaching are distinct operations, if I load a package .onLoad (and only .onLoad) is run, if I attach a package then .onAttach (and only .onAttach) is run". But the manual continues a bit further down with Packages are n...
2020 Oct 11
3
Installing bioconduction packages in connection with loading an R package
...ositories() to make sure that R also installs packages from bioconductor. Having to call setRepositories causes what can perhaps be called an (unnecessary?) obstacle. Therefore I have been experimenting with deferring installation of these bioc-packages until gRbase is loaded the first time using .onAttach; please see my attempt below. However, if the bioc-packages are not installed I can not install gRbase so that does not seem to be a viable approach. (The bioc-packages appear as Imports: in DESCRIPTION). Can anyone tell if it is a futile approach and / or perhaps suggest a solution. (I would gue...
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 p...
2013 Jan 15
1
Can not load Rcmdr
I am getting the error message: > library(Rcmdr) Loading required package: car Loading required package: MASS Loading required package: nnet Error : .onAttach failed in attachNamespace() for 'Rcmdr', details: call: structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class = "tclObj") error: [tcl] invalid command name "image". Error: package/namespace load failed for 'Rcmdr' If I tr...
2024 Mar 06
1
Never exporting .__global__ and .__suppressForeign__?
...space.R (working copy) @@ -806,7 +806,8 @@ if (length(exports)) { stoplist <- c(".__NAMESPACE__.", ".__S3MethodsTable__.", ".packageName", ".First.lib", ".onLoad", - ".onAttach", ".conflicts.OK", ".noGenerics") + ".onAttach", ".conflicts.OK", ".noGenerics", + ".__global__", ".__suppressForeign__") exports <- exports[! exports %in% st...
2005 Sep 21
5
error when loading rwinedt
the error msg is: > local({pkg <- select.list(sort(.packages(all.available = TRUE))) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) Error in if (RWinEdtVersion) RWinEdtVersion <- scan(file.path(InstallRoot, : argument is of length zero Error: .onAttach failed in 'attachNamespace' Error: package/namespace load failed for 'RWinEdt' > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status alpha major 2 minor 2.0...
2020 Jun 23
4
Restrict package to load-only access - prevent attempts to attach it
...eclare this package under 'Imports' or 'Suggests' but never under 'Depends'. I can document this and hope that's how it's going to be used. But, I'd like to make it explicit that this API should be used via imports or ::. One approach I've considered is: .onAttach <- function(libname, pkgname) { if (nzchar(Sys.getenv("R_CMD"))) return() stop("Package ", sQuote(pkgname), " must not be attached") } This would produce an error if the package is attached. It's conditioned on the environment variable 'R_CMD' se...
2010 Feb 04
3
mgcv problem
...39;mgcv' which can be load. I proved to eliminated and reinstalled but always obtain the same message: > library (mgcv) This is mgcv 1.6-1. For overview type `help("mgcv-package")'. Error in runif(1) : .Random.seed is not an integer vector but of type 'list' Error : .onAttach non riuscito in attachNamespace Errore: caricamento pacchetto/namespace fallito per 'mgcv' I appreciate very much your help Rosa. [[alternative HTML version deleted]]
2009 Feb 13
2
loading mgcv package
Hi ,When I try to load the 'mgcv" package, often, but not always, get this error message. What am I doing wrong? __________________ This is mgcv 1.4-1.1 Error in runif(1) : .Random.seed is not an integer vector but of type 'list' Error : .onAttach failed in 'attachNamespace' Error: package/namespace load failed for 'mgcv' ----------------------------------------- Thanks. Chetty -- Professor of Family Medicine Boston University Tel: 617-414-6221, Fax:617-414-3345 emails: chettyvk@gmail.com,vchetty@bu.edu [[alternative HTML...
2010 May 11
2
RWinEdt in WinEdt 6
I'm having difficulty installing RWinEdt in WinEdt6. I receive the following message: Error : .onAttach failed in attachNamespace() for 'RWinEdt', details: call: getWinEdt() error: WinEdt is not installed properly. I have tried following the manual instructions in the readme.txt without success. I receive the following message: WinEdt's Initialization File "C:\Program Files (x...
2011 Jan 26
1
Problem with "setMethod" in R package
...ethod(...). When I do this outside the package (after loading the package with "library(...)"), everything works smoothly. However, when I try to incorporate the call to setMethod(...) in the package code itself, the only way I get it to work is to include the call in .onLoad(...) or .onAttach(...). This works, but when loading the library I get the messages "creating new generic function for "plot" in ".GlobalEnv", as well as "no definition for class "Rcpp_rothC""... Again, the code works, but the messages let me presume that I add the me...
2009 Feb 10
3
tcltk, tcltk2, Rcmdr, Mac OS X
Dear Colleagues, When I try to install Rcmdr the following happens: ---------------------------------- > library(Rcmdr) Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class = "tclObj") : [tcl] invalid command name "font". Error : .onAttach failed in 'attachNamespace' Error: package/namespace load failed for 'Rcmdr' ---------------------------------- I wondered if this is because there is no "tcltk" package installed. So I tried: ---------------------------------- > install.packages("tcltk") W...
2012 Apr 07
4
Display instruction text on package load
I'm currently working on a new package for R that interfaces with an API. Most of the package's functionality requires users to supply an access key that allows the package to work with the API. I want to display text immediately upon loading the package that instructs/reminds users to enter their access key before attempting to do anything (as the package won't really work without
2011 Mar 01
2
problems with playwith
...iled to load RGtk2 dynamic library, attempting to install it. Learn more about GTK+ at http://www.gtk.org If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN Error : .onAttach failed in attachNamespace() for 'gWidgetsRGtk2', details: call: .Call(name, ..., PACKAGE = PACKAGE) error: C symbol name "S_gtk_icon_factory_new" not in DLL for package "RGtk2" Error: package 'gWidgetsRGtk2' could not be loaded > > Sys.getenv("PAT...
2005 Jan 27
7
getting package version inside .First.lib
Greetings - Is it possible, inside .First.lib, to find out the version number of the package that is being loaded? If only one version of the package has been installed, we could scan the DESCRIPTION file, something like .First.lib <- function(lib, pkg) { library.dynam("spatstat", pkg, lib) dfile <- system.file("DESCRIPTION", package="spatstat")
2010 Nov 16
2
Playwith-problem with loading
...; length 7820679 bytes (7.5 Mb) opened URL downloaded 7.5 Mb Learn more about GTK+ at http://www.gtk.org If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN Error : .onAttach failed in attachNamespace() for 'gWidgetsRGtk2', details: call: .Call(name, ..., PACKAGE = PACKAGE) error: C symbol name "S_gtk_icon_factory_new" not in DLL for package "RGtk2" Error: package 'gWidgetsRGtk2' could not be loaded >
2019 Jun 29
2
R-Forge > GitHub?
...missing?? [Note:? I used my actual GitHub password in place of "mypassword" here, and this "Authentication failed" message reported the GitHub password I used here.] ????? Thanks, ????? Spencer p.s.? I'm doing this under macOS Mojave 10.14.5.? Also,? I added ".onAttach" functions to the R-Forge versions as Brian G. Peterson suggested.? That seemed to work fine. On 2019-06-28 07:13, Duncan Murdoch wrote: > On 28/06/2019 6:26 a.m., G?bor Cs?rdi wrote: > >> Instead, you can do as Duncan suggested, and put a README in your >> R-Forge >&g...