[Rd] Building an R GUI using gWidgets and RGtk2

2007-09-14 Thread Gerlanc, Daniel
Hello,

I'm developing a GUI in R that will be used to monitor financial
portfolio performance.  The GUI will be distributed as an R package.  So
far, I've decided to use the "cairoDevice", "RGtk2", "gWidgets", and
"gWidgetsRGtk2" packages to develop the GUI.  I am trying to decide what
would be the best way to structure the GUI would be.

I've considered 3 approaches to building the GUI.  The first would be to
use S4 classes.  I would create parent "gui" object that would store
widgets or containers in slots.  Other more specialized guis for
different purposes would extend this parent "gui" object.  The
difficulty in this approach is R's use of pass-by-value.  Once the gui
object has been created, changing any of the slots of the gui requires
returning a new GUI object or saving one off in a higher level
environment and editing the slots directly.  Editing the slots directly
would completely bypass the S4 method dispatch.

Another approach would be more functional.  I would create variables
that are global within the package or in their own environment and
define the package function closures within this environment.  This
could work, but the code could get noisy when calls to have be made to
distinguish between local variable assignment within the environment of
the functions and assignment within the namespace of the package.

The third approach I've been considering is using the R.oo package.  I
have never used this package before but it appears to provide similar OO
features to Java.  Because it allows references, it would seem to
provide the features I'm looking for from both the S4 and functional
approaches.

Any comments or suggestions on these different approaches would be
appreciated.

Thank you.

Sincerely,

Daniel Gerlanc

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] var/sd and NAs in R2.7.0

2008-05-16 Thread Gerlanc, Daniel
Perhaps _sd_ should take a ... argument.

-- Dan 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gabor Grothendieck
Sent: Friday, May 16, 2008 11:03 AM
To: McGehee, Robert
Cc: R-devel
Subject: Re: [Rd] var/sd and NAs in R2.7.0

Try

var(c(NA, NA, NA), use = "pairwise.complete.obs")


On Fri, May 16, 2008 at 10:56 AM, McGehee, Robert
<[EMAIL PROTECTED]> wrote:
> Hello all,
> I just upgraded to R 2.7.0 and found that the behavior of 'var' and
'sd'
> have changed in the presence NAs (this wasn't explicit in the NEWS
file,
> though I see it probably has to do with the change for cor/cov).
Anyway,
> I just want to make sure that it was intentional to produce an error
> when there was all NAs and na.rm=TRUE, rather than returning an NA
(like
> R 2.6.2), or NaN (like the function 'mean' does). That is, isn't the
> purpose of 'na.rm=TRUE' to, in part, suppress these error messages.
>
> Specifically,
>> var(c(NA, NA, NA), na.rm=TRUE) # R2.6.2
> [1] NA
>> var(c(NA, NA, NA), na.rm=TRUE) # R2.7.0
> Error during wrapup: no complete observations in cov/cor
>
> I think I can get the old behavior by setting use='p', but the 'sd'
> function does not have a 'use' argument and I'd like not to get an
error
> here. Anyway, I'm a fan of the old behavior (not producing an error),
> but if there was a reason to change this when na.rm=TRUE, I would
> request that the 'sd' function be updated to be able to revert to the
> old behavior as well.
>
> FYI: I 'apply' these functions to large matrices of stock return time
> series with missing values, and don't want the whole calculation to
fail
> just because I'm missing stock returns for one company.
>
> Thanks,
> Robert
>
> Robert McGehee, CFA
> Geode Capital Management, LLC
> One Post Office Square, 28th Floor | Boston, MA | 02109
> Tel: 617/392-8396Fax:617/476-6389
> mailto:[EMAIL PROTECTED]
>
>
>
> This e-mail, and any attachments hereto, are intended
fo...{{dropped:11}}
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel