Displaying 20 results from an estimated 600 matches similar to: "what is the preferred method to create a package local variable?"
2009 Oct 27
1
How to reduce key strokes when defining S4 classes?
I feel tedious when I define a S4 class and the methods. For each
method, I have to call both setMethod and setGeneric (or both
setReplaceMethod and setGeneric). I would like a more compact grammar
so that I can reduce the key strokes. I'm wondering if there is a
better way available.
setClass(
Class='A',
representation=representation(
x='numeric'
)
2006 Sep 12
1
package.skeleton() in R-2.4.1
Hi
R version 2.4.0 alpha (2006-09-06 r39158)
MacOSX 10.4.7
There was a thread some time ago as to whether the structure created by
package.skeleton() would pass R CMD check.
I have an example where package.skeleton() gives an R file that gives an
error when sourced.
If I type
setClass("brob",
representation = representation
2007 May 25
1
Question about setReplaceMethod
Hi
I have the code like I show below. The problem here is that I have a setReplacementMethod to set the value of my class slot. However, this function doesn't work when I call it within another function definition (declared by setMethod) of the same class. I do not understand this behavior that much. I'm wondering how to make this work? Any help would be really appreciated. Thank you.
2010 Oct 20
1
Function execution on package load?
Hi,
Can anyone give me a pointer on howto make a package execute a function at
loading?
Following an older post (http://bit.ly/cS1Go4), I'd like to do something
along the lines of
> .localstuff <- new.env()
> .localstuff$OftenUsedData <- read.csv(...)
upon loading the package ...
Thanks, Joh
2010 Jan 20
1
Retrieving data through bbg or excel, what is faster?
Hello, I need to retrieve datas from bloomberg.
I want to retrieve those datas in the fastest way as possible. I have two
options:
writing the datas from bbg to excel and reading from r the excel sheet or
directly
read the datas from from r with a Rbbg connection. Which connection is
faster?
Thank you
--
View this message in context:
2011 Aug 26
1
R.oo data members / inheritance
If someone is able, can you tell me if there is a better way to do this?
More specifically, do I have to rewrite all of the data members stuff and
extend stuff of parent class in the child class? See below. Thanks in
advance!
Example 1:
setConstructorS3("ClassA", function(A,x) {
if(missing(A))A=15;
if(missing(x))x=NA;
extend(Object(), "ClassA",
.size = A,
.x=x
2010 Dec 06
2
ggplot2: Controlling line width of panel borders
Dear R-users,
i encountered some problems when trying to adjust the line width of the
axes and stripes in a plot created with ggplot2.
I use the "barley" dataset of the lattice package to illustrate my problem:
library(ggplot2)
library(lattice)
barley[["SD"]] <- 5
limits <- aes(ymax=barley$yield + barley$SD,ymin=barley$yield - barley$SD)
p1 <-
2012 Feb 16
2
Problem building up ggplot graph in a loop.
Folks,
I want to automate some graphing using ggplot.
Here is my code
graphChargeOffs2<-function(coffs) {
ggplot(coffs, aes(levels))
dataNames<-names(coffs)[!names(coffs) == "levels"]
for(i in dataNames) {
thisData<-coffs[[i]]
last_plot() + geom_line(aes(y = thisData, colour = i))
}
last_plot() + ylab("Total Chargeoffs")
}
coffs is a data.frame.
2006 Jan 02
2
mouse position without event
Hello,
Is it possible somehow to get mouse coordinates without using the event
mechanism ?
I need to get the current mouse position to initialize some div position,
but not at page load
Tarek
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
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 Apr 07
3
Pointer position on keypress event?
Hi.
Is there any straightforward way to tell pointer position (x, y)
upon keypress? In original wxWidgets, wxKeyEvent supports GetX()
and GetY() methods, but wxRuby''s KeyEvent object does not have
one. I also checked with event.methods and event.instance_variables.
Do I need to keep track of pointer position by evt_motion?
--
Taisuke Yamada <tyamadajp@spam.rakugaki.org>,
2008 Oct 23
1
Getting the panel location of a xyplot matrix using a mouse click in a GDCanvas
Hi:
I would like to find out the panel of a xyplot matrix where a mouse clicked.
I know this functionality is already bundled in trellis.focus but I can't
use it because I am coding a stand alone application in Java using with
GDCanvas as a graphics device.
I tried calling trellis.focus from Java with:
re.eval("t = trellis.focus()"));
However it did not work for an embedded
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 Dec 30
1
Fwd: Negbin Error Warnings
Dear Clara,
Thanks for the reply. I am forwarding your message to the list, ok.
When I wrote was a way of get further information to help the helpers.
happy holidays,
milton
---------- Forwarded message ----------
From: Clara Brück <clara_brueck@web.de>
Date: 2009/12/30
Subject: Re: [R] Negbin Error Warnings
To: milton ruser <milton.ruser@gmail.com>
Dear Milton,
Thanks for
2024 May 15
1
FR: Customize background colour of row and column headers for the View output
A criticism of your suggestion is that it is not backwards compatible.
Does that matter? I don't know, but probably not. The X11 version of
the viewer does what you suggest.
Duncan Murdoch
On 2024-05-15 2:20 a.m., Iago Gin? V?zquez wrote:
> About the decisions:
>
> Actually, the same way dataedittext modifies the text colour not only
> of data, but also of row and column
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,
2006 Mar 06
3
Disconnect all MySQL connections
Hi
I've got the error "cannot allocate a new connection -- maximum of 16 connections
already opened" after I tried to create a new connection to a database. However,
the reason ist, that i did not disconnect previous connections....
I don't know the name of this connections. How can I disconnect this "unknown"
connections and drivers? if I delete all objects, the
2006 Jul 10
4
Detecting the close of a browser
Hi,
I noticed that www.meebo.com has the ability that when you close the
browser during a session, it prompts you , are you sure you want to
close?
How does it do this? I would like to use such an ability , so that if
the user preempts a close on the browser, I can kill all threads I have
running for that user.
Thanks
--
Posted via http://www.ruby-forum.com/.
2011 Aug 03
1
NAMESPACE problems
Hi.
I am having difficulty following section 1.6.6 of the R-extensions manual.
I am trying to update the Brobdingnag package to include a NAMESPACE file (the
untb package requires the Brobdingnag package).
Without the NAMESPACE file, the package passes R CMD check cleanly.
However, if I include a NAMESPACE file, even an empty one, R CMD check
gives the following error in 00install.out:
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