similar to: on.exit called on loading ?

Displaying 20 results from an estimated 4000 matches similar to: "on.exit called on loading ?"

2010 Sep 16
1
Possible bug or annoyance with library.dynam.unload()
Hello, I have a package with a namespace. Because I use Roxygen that overwrites the NAMESPACE file each time it is run, I use a R/zzz.R file with an .onLoad() and .onUnload() functions to take care of loading and unloading my shared library. The problem: if I load my library from a local directory, then the unloading of the package fails, e.g: # loads fine >library(Foo,
2016 Mar 25
1
library.dynam.unload
The survival package has a firstlib.R file that I had forgotton and just reviewed. After deleting several bits which had a use 10 years ago during my Splus to R transition, the only thing remaining is .onUnload <- function(libpath) library.dynam.unload("survival", libpath) Does this bit of code still serve a purpose? Can I toss it? Terry T.
2006 Feb 08
2
Using .onUnload() to unload compiled code
If one wants to unload compiled code for a package containing a namespace, my understanding is that .onUnload() should be used, with a call to library.dynam.unload(). This is used in e.g., the stats and methods packages, but it appears to me that the compiled code is not being unloaded when the package is detached(). Am I misunderstanding something? Best, Jim > search() [1]
2009 May 18
1
Auto-upgrading a package under Windows ?
I was trying to be cute with a company-internal package and used if (Sys.info()["sysname"]=="Windows") { update.packages(repos="http://some.where.internal/R", ask=FALSE) } but that of course fails as the package itself is loaded and cannot be upgraded (as it contains a dll) when loaded. Smart move by the OS. Can anybody suggest a workaround, other
2010 Nov 12
1
unloading compiled code.
I have a package that I'm developing that I need to unload the library. Long story short I figured out that the leaving the compiled code loaded lead to a segmentation fault, but unloading the code will fix it. I've read the documentation and it appears that there are several ways to do this? What is the popper accepted current standard for unloading compiled code? The options as I
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.
2012 Jul 24
1
Using .onUnload to unload DLLs
I've noticed that many of the "base" R packages have an .onUnload() function which automatically unloads compiled shared libraries with library.dynam.unload(). For example: > stats:::.onUnload function (libpath) library.dynam.unload("stats", libpath) <bytecode: 0x1033b9c30> <environment: namespace:stats> I've noticed that many other packages don't
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
2006 Aug 16
1
How to pass an array to a javascript function.
Hi - I''m having a bit of trouble with my application. I have this view that calls a javascript function "zip_map". I want to pass to it a scalar array "@zip_geo" but I don''t know how to pass an array to a javascript function in rails. This is what the code looks like: THE .rhtml file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
2008 Apr 24
4
Scriptaculous Help (page exit effects)
I was wondering if it was possible in Prototype/Scriptaculous to run an effect when a link is clicked, then go to that page, or if it was possible to have an effect run when the page unloads. I have tried <body onunload="new Effect.Fade("whatever");> and some prototype page exit events, could get a alert("") function to work, but not the effects. Any ideas?
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)"
2006 Jun 16
11
Detecting Body Onload
I have a piece of code that "waits" for body onload. Every 30ms, it tests $(''body''). Seems that isn''t always good enough. I''ve hit situations where the DOM is "partially" loaded somehow. I fixed matters by setting a global flag... <body onload="bodyLoaded=true;"> which provides a better test... of course I could
2013 Nov 06
1
How to do package cleanup: hooks .onUnload, R_unload_mylib, .onDetach are not called on quit
Hi, it seems that the package hooks .onLoad and its C++ pendant R_unload_mylib are actually not called when R quits, but only when explicitly calling detach('package:mylib', unload = TRUE). Maybe this is platform specific, I'm on Ubuntu 13.10 - R 3.0.2 (see below). * is there a mechanism that a package can use to effectively do some cleanup on standard exit, such as calling
2008 Mar 19
0
[LLVMdev] Proposal for GSoC project for improving llvm-test testsuite
> "Didn't work" means... what? Compilation failed? Program doesn't work? > Either way: what mesages do you get? The graphical screen was just blank. darkplaces emits some log messages as usual. But step by step... Used LLVM-GCC ------------- The used llvm-gcc, when run with "llmv-gcc --version" shows "llvm-gcc (GCC) 4.2.1 (Based on Apple Inc. build 5546)
2012 Feb 01
5
Mac markdown editor that saves as .txt
Hi all, I'm a newer user of markdown & MultiMarkdown, and I'm looking for the perfect setup of software for my Mac and my Android phone. I'd like to have my drafts editable from both. What I want is an attractive Mac app for writing (primarily blog posts and emails) that saves its files as .txt . Most of them save as .md or .markdown instead, and since there doesn't seem to
2009 Nov 15
2
Segmentation faults on SEXP conversion
Hello - I am making a first attempt at writing a simple C++ routine to print out R objects (this is a simple proof-of-concept as part of a larger package development). The relevant C++ routine is as follows: void Rwrite(SEXP fd, SEXP msg) { int *ofd = INTEGER(fd); const char * omsg = CHAR(asChar(msg)); printf("[%i] %s",*ofd,omsg); } And the corresponding interface in R is as
2006 May 18
1
Recommended style with calculator and persistent data
I have some calculations that require persistent state. For example, they retain most of the data across calls with different parameters. They retain parameters across calls with different subsets of the cases (this is for distributed computation). They retain early analysis of the problem to speed later computations. I've created an S4 object, and the stylized code looks like this calc
2005 Oct 04
1
more problems when using "installWithVers"
R-devel, SVN revision 35729 (this morning, euro-time) So far, I'm having awful luck with the "installWithVers" flags. Recent example: I can install.packages("lattice", installWithVers=TRUE) successfully (no errors, at least it looks like a successful install), but can't load it: Error in library.dynam(pkg,pkg,lib) : shared library 'lattice_0.12-7' not found
2004 Aug 04
1
installing package with version number using namespaces & dynamic library
Hi, I wonder whether a package with namespace & dynamic library can be installed with the version number attached, ie. with the argument --with-package-versions. Is this currently possible? Using R 1.9.1 on Debian 3.0 I encounter a problem when trying to load a package installed with R91 CMD INSTALL --with-package-versions -l /mnt/local/R/R-1.9.x-libs-EpiR RIO in R started with R91
2010 Jan 26
1
library.dynam
hi, i'm having some trouble getting a package to load a shared library object in .onLoad(...) i have a shared object file, say "mylib.so". if i start an R session, and via the CLI specify the actual library via: > dyn.load("mylib.so") everything works quite well (i.e. i can then follow with some .Call (...) methods) now, i'd like to include this shared library in