Re: [Rd] Extract/format/show for S4 objects

2010-06-09 Thread Jeffrey J. Hallman
The tis package has the ti (TimeIndex) class that does what you want, and I modestly think it's nicer than the zoo stuff. As for S4 classes, there's a good reason many of us don't use them: they're too inflexible and hard to program with. I wouldn't go there unless I really had to. Johann Hibsc

Re: [Rd] Calling C functions with value parameters

2009-08-18 Thread Jeffrey J. Hallman
replying to myself here, in lieu of replying to several others jhall...@frb.gov (Jeffrey J. Hallman) writes: > One hassle I could do without is the necessity of writing C wrapper functions > like this: > > void fameInit(int *status){ > cfmini(status); > return; > } >

[Rd] Calling C functions with value parameters

2009-08-18 Thread Jeffrey J. Hallman
One hassle I could do without is the necessity of writing C wrapper functions like this: void fameInit(int *status){ cfmini(status); return; } when I want to call a library function (cfmini, in this case) that takes an int argument. The .C interface only lets me pass a pointer to an int, rat

[Rd] configure.vars arg needed for install.packages

2008-11-19 Thread Jeffrey J. Hallman
Currently, install.packages takes a 'configure.args' argument that adds a --configure-args to the eventual call to R CMD INSTALL. It does not, however, have a 'configure.vars' argument to similarly add the --configure-vars option to R CMD INSTALL, which seems to be an oversight. -- Jeff ___

[Rd] postscript(colormodel = "cmyk") conversion is wrong

2008-05-22 Thread Jeffrey J. Hallman
The conversion of RGB to CMYK takes place in PostScriptSetCol() starting at line 2900 of R-2.7.0/src/library/grDevices/src/devPS.c if(strcmp(mm, "cmyk") == 0) { double c = 1.0-r, m=1.0-g, y=1.0-b, k=c; k = fmin2(k, m); k = fmin2(k, y); if(k =

Re: [Rd] assigning NULLs to elements of a list

2008-02-12 Thread Jeffrey J. Hallman
>From your tone, I gather you don't much like this behavior, and I can see your point, as it not very intuitive that setting a list element to NULL deletes any existing element at that index. But is there a better way to delete an element from a list? Maybe there should be. Jeff Prof Brian Rip

Re: [Rd] argument order for Math2 group functions in R 2.6.x (PR#10679)

2008-02-06 Thread Jeffrey J. Hallman
You could always define your own signif() as signif <- function(x, digits = 6){ base::signif(x, digits) } I do something like this for signif() and round() because economists don't like the round-to-even convention R uses. My round() function, for example, is: round <- function(x, digits = 0

Re: [Rd] Wrong length of POSIXt vectors (PR#10507)

2007-12-17 Thread Jeffrey J. Hallman
Duncan Murdoch <[EMAIL PROTECTED]> writes: > One reason I don't want to work on this is because the appropriate > action depends on what "length(x)" is intended to mean. Currently for > POSIXlt objects, it gives the physical length of the underlying basic > type (the list). This is the same b

Re: [Rd] [R] aggregate.ts

2007-07-26 Thread Jeffrey J. Hallman
aggregate.tis() in the fame package does what I think is the right thing: > x2 <- tis(1:24, start = c(2000, 11), freq = 12) > y2 <- aggregate(x2, nfreq = 4) > x2 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 2000 1 2 2001 3 4 5 6 7 8

Re: [Rd] One for the wish list - var.default etc

2007-05-09 Thread Jeffrey J. Hallman
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > On Wed, 9 May 2007, S Ellison wrote: > > > Brian, > > > >> If we make functions generic, we rely on package writers implementing > >> the documented semantics (and that is not easy to check). That was > >> deemed to be too easy to get wrong for v

Re: [Rd] fix() changes the class of mts objects

2007-05-09 Thread Jeffrey J. Hallman
"Simone Giannerini" <[EMAIL PROTECTED]> writes: > My concern here is that users can be confused from the fact that if one has > a single time series fix() uses the default method of edit() and does not > change > its class > > > x <- ts(1:5) > > fix(x) > > class(x) > [1] "ts" > > whereas for mts

Re: [Rd] How to override functions in namespaces?

2007-02-23 Thread Jeffrey J. Hallman
Prof Ripley, Thanks to both you and Duncan Murdoch, who replied with similar advice. Your suggestion to use get("askForString", pos = 1)() in my ssh() function does what I want whether package B is attached or not. Jeff Prof Brian Ripley <[EMAIL PROTECTED]> wrote: br> On Mon, 12 Feb 2007, [EMA

Re: [Rd] RPM support for package installation?

2007-02-08 Thread Jeffrey J. Hallman
I feel your pain. At my workplace, the network administrators insist that anything that is to be distributed across the network be packaged up in an RPM. I have my own library of packages accessible to my section members, but when I want to make something available to everyone, I have to create a

[Rd] Help with OS X (BSD) ps command

2007-02-02 Thread Jeffrey J. Hallman
My fame package has a function that checks to see if a FAME SERVER process is already running. On Linux, I can do this in one of two ways: pid <- Sys.getpid() user <- Sys.info()["user"] cmd <- paste("pgrep -fU", user, "-P", pid, "'FAME SERVER'") fameRunning <- as.logical(length(system(cm

Re: [Rd] Am I missing something about debugging?

2007-01-03 Thread Jeffrey J. Hallman
Thoughts from a pro-Smalltalk bigot: "Byron Ellis" <[EMAIL PROTECTED]> writes: > While a Smalltalk-style debugger would be pretty awesome, I suspect > R's semantics would make restartable exceptions pretty difficult and > R's current implementation would make getting the continuation-like > object

Re: [Rd] dyn.load and function calls without 'PACKAGE' argument

2006-12-08 Thread Jeffrey J. Hallman
Duncan Temple Lang <[EMAIL PROTECTED]> wrote: dtl> [EMAIL PROTECTED] wrote: >> dyn.load("/opt/fame/timeiq/lib/linux_x86/libjchli.so", local = F) >> library.dynam("fame", package = "fame") >> The code in fame.so uses functions found in libjchli.so, making the >> 'local = F' argument in dy

[Rd] [EMAIL PROTECTED]: dyn.load and function calls without 'PACKAGE' argument

2006-12-08 Thread Jeffrey J. Hallman
I sent this to r-help and then realized it should really go to r-devel. --- Begin Message --- I'm writing a package that interfaces to the FAME database, via a library of compiled C routines accessible through a Linux .so file. My .onLoad() function loads the .so like this: dyn.load("/opt/fame/t

Re: [Rd] tcltk::tk_select.list has bad width (PR#9410)

2006-12-06 Thread Jeffrey J. Hallman
Peter Dalgaard <[EMAIL PROTECTED]> wrote: pd> [EMAIL PROTECTED] wrote: >> The window put up by tcltk::tk_select.list appears to be of fixed width (20 >> chars), and is not wide enough to accomodate strings longer than 20 characters >> long. This can be easily fixed by setting the option

[Rd] R-2.2.0 format.default() loses matrix structure (PR#8696)

2006-03-20 Thread Jeffrey . J . Hallman
If argument big.mark is supplied. Like so: > version _ platform i686-redhat-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R > mat <- matrix(1:6, 3) > mat [,1] [,2] [1,]

Re: [Rd] [R-gui] R GUI considerations (was: R, Wine, and multi-threadedness)

2005-10-20 Thread Jeffrey J. Hallman
>>>>> "b" == Byron Ellis <[EMAIL PROTECTED]> writes: b> On Oct 19, 2005, at 3:43 PM, Jeffrey J. Hallman wrote: >> If you're looking for a GUI toolkit that: >> >> 1. Is cross-platform, >> 2. Has a good collection of widge

Re: [Rd] [R-gui] R GUI considerations (was: R, Wine, and multi-threadedness)

2005-10-20 Thread Jeffrey . J . Hallman
Walter Johnston <[EMAIL PROTECTED]> wrote on 10/20/2005 12:21:09 PM: > A couple of non-flame comments and a question - > > (1) I have used Smalltalk in various forms and recommend it > highly as an environment (try Squeak for a free implementation); > it is the origin of the model-view-controlle

Re: [Rd] [R-gui] R GUI considerations (was: R, Wine, and multi-threadedness)

2005-10-19 Thread Jeffrey J. Hallman
>>>>> "K" == Kasper Daniel Hansen <[EMAIL PROTECTED]> writes: K> On Oct 19, 2005, at 3:43 PM, Jeffrey J. Hallman wrote: K> >> Think about it. Once you have a basic math package that can handle >> matrix >> programming a

Re: [Rd] [R-gui] R GUI considerations (was: R, Wine, and multi-threadedness)

2005-10-19 Thread Jeffrey J. Hallman
If you're looking for a GUI toolkit that: 1. Is cross-platform, 2. Has a good collection of widgets that look good on all platforms, and 3. Is easy to work with from R then it is hopeless. There is no such toolkit. As one poster mentioned, most of the better GUI toolkits are very ob