Re: [R] Time series merge?

2011-12-07 Thread Jeffrey J. Hallman
Or see "mergeSeries" in package 'tis'. -- Jeff __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] Plotting Time Series Data by Month

2011-12-07 Thread Jeffrey J. Hallman
If you can wait a day or two, the next version (1.18) of the 'tis' package that I will put on CRAN very soon has a function called "tierChart" that does what you want with a 'tis' series. -- Jeff __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] [R-pkgs] New package "list" for analyzing list surveyexperiments

2010-07-14 Thread Jeffrey J. Hallman
Well, as the author of two CRAN packages with short names (tis and fame), I maintain that short names can be fairly informative. The fame package is an interface to FAME time series databases, and the tis package implements the tis (TimeIndexedSeries) class and support classes that it needs. When

Re: [R] [R-pkgs] New package "list" for analyzing list survey experiments

2010-07-12 Thread Jeffrey J. Hallman
I know nothing about your package, but "list" is a terrible name for it, as "list" is also the name of a data type in R. -- Jeff __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

Re: [R] Documentation for library() and how to specify missing arguments

2010-07-02 Thread Jeffrey J. Hallman
Gabor Grothendieck writes: > Try this: > >> mx <- formals(identity)$x >> missing(mx) > [1] TRUE >> sin(mx) > Error in sin(mx) : 'mx' is missing Neat. There's no way to look at 'mx' because calling any function with it as an argument gives that same error message, including the auto print function

Re: [R] Subscripting a matrix-like object

2010-05-14 Thread Jeffrey J. Hallman
jhall...@frb.gov writes: Answering my own question here, so you can ignore this unless you are really interested in some fairly obscure stuff. It turns out that this works: singleIndex <- missing(j) && (length(sys.call()) == length(match.call())) since sys.call() has an element for the empty ar

Re: [R] Vectorized expression to extrapolate matrix columns with columns of another matrix

2010-05-12 Thread Jeffrey J. Hallman
Abiel X Reinhart writes: > I have two identically sized matrices of data that represent time series (I > am storing the data in zoo objects, but the idea should apply to any matrix > of data). The time series in the second matrix extend further than in the > first matrix, and I would like to u

Re: [R] Assigning Week Numbers

2010-04-21 Thread Jeffrey J. Hallman
Take a look at the 'ti' stuff in the tis package on CRAN. If I understand you correctly, you want something like this: weekNumber <- function(aDate){ aTi <- ti(aDate, tif = "wfriday") may1ymd <- 1*year(aTi) + 501 baseWeek <- ti(may1ymd, tif = "wfriday") return(aTi - baseWeek +

Re: [R] aggregate for zoo or its?

2010-03-08 Thread Jeffrey J. Hallman
Or for real power and flexibility, see the 'convert()' function in package tis. Jeff Gabor Grothendieck writes: > See ?aggregate.zoo, e.g. > > library(zoo) > z <- zoo(1:1000, as.Date("2000-01-01") + 0:999) > aggregate(z, as.yearmon, mean) > > or replace mean with whatever summarization you want.

Re: [R] Entire Organization Switching from SAS to R - Any experience?

2009-07-20 Thread Jeffrey J. Hallman
Hmmm, I sense a story in the offing. Was that an accidental emergency, or one you created? Frank E Harrell Jr writes: > I differ with Marc in one way. It is amazing what people can learn when you > create an emergency for them to do so. > > Frank > -- > Frank E Harrell Jr Professor and Chair

[R] Adding a method to a generic in another package

2009-06-02 Thread Jeffrey J. Hallman
I am the maintainer of the 'tis' package. One of the functions in my package is 'nberShade'. A user wants to make nberShade generic, with the old version renamed as nberShade.default, all of which is fine with me. And he wants to add a new method, nberShade.ggplot, which works for objects of cla

Re: [R] dividing ts objects of different frequencies

2009-03-05 Thread Jeffrey J. Hallman
"Stephen J. Barr" writes: > I have two time series (ts) objects, 1 is yearly (population) and the > other is quarterly (bankruptcy statistics). I would like to produce a > quarterly time series object that consists of bankruptcy/population. > Is there a pre-built function to intelligently divide t

Re: [R] windows vs. linux code

2009-02-26 Thread Jeffrey J. Hallman
Rolf Turner writes: > Despite the knowledge, wisdom, insight, skill, good looks, and other > admirable characteristics of the members of the R-help list, few of > us are skilled in telepathy or clairvoyance. Oh, yeah? Then how did I know you were going to say that, huh? -- Jeff __

Re: [R] R scripts and parameters

2009-02-20 Thread Jeffrey J. Hallman
Here's how I do this: The last lines of my .First() function are these: ## Run command line program if there is one if(length(.cmd <- commandArgs(trailingOnly = TRUE)) > 0) try(source(textConnection(.cmd), echo = T, prompt.echo = "> ")) and on my Linux path I have this csh script, called "runR"

Re: [R] how to study the lead and lag relation of two time series?

2009-01-23 Thread Jeffrey J. Hallman
Yes, it's called Ocular Econometrics. You plot both series on the same chart and use your onboard pattern detector. If you can't see it on the plot, it's unlikely that any correlations you find in other ways will have much predictive power, and that's the only kind of relationship that counts. I

Re: [R] Problem with FAME

2009-01-21 Thread Jeffrey J. Hallman
My bad. I used system("test -r blah") to see if a file was readable, forgetting that not all Windows installations have the "test" program (from Cygwin) installed. I've changed this to use the R function file.access() in version 2.5, which I've just submitted to CRAN. The Windows binary should b

Re: [R] R in the NY Times

2009-01-07 Thread Jeffrey J. Hallman
The article quotes John Chambers, but it doesn't mention that R started out as an implementation of the S language. I don't suppose Insightful is too happy about that. The SAS spokesman quoted in the article is clearly whistling past the graveyard. -- Jeff __

Re: [R] question about the tisPlot function in package tis

2008-12-02 Thread Jeffrey J. Hallman
[EMAIL PROTECTED] writes: > List, > > I am using the 'tisPlot' function in Jeff Hallman's excellent tis package > and was hoping that someone could spare me from having to dig into the > code of his 'tisPlot' function. So far as I can tell, the preferred > method of controlling the plotting of

Re: [R] Cannot quit R - fame package issue?

2008-11-19 Thread Jeffrey J. Hallman
I am the author of the 'fame' package, and I can confirm that earlier versions did indeed use Greg Warnes addLast() function to add to the user's .Last() function. The current version no longer does so. Jeff Dan Slayback <[EMAIL PROTECTED]> writes: > Thanks very much for the tips. Simply remo

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-12 Thread Jeffrey J. Hallman
"hadley wickham" <[EMAIL PROTECTED]> writes: > dates <- structure(c(8516, 8544, 8568, 8596, 8609, 8666, 8701, 8750, 8754, > 8798, 8811, 8817, 8860, 8873, 8918, 8931, 8966, 9020, 9034, 9056 > ), class = "Date") > >> range(dates) > [1] "1993-04-26" "1994-10-18" >> as.Date(ti(range(dates), "monthly")

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Jeffrey J. Hallman
Look at the ti (Time Index) class in package tis. Here's some examples I just did: > x <- Sys.Date() > x [1] "2008-09-11" > ti(x, "wsaturday") ## a ti for the week that x falls into [1] 20080913 class: ti > ti(x + 1, "wsaturday") - 1 ## ti for the latest complete week [1] 20080906 class:

Re: [R] time series by calendar week

2008-07-08 Thread Jeffrey J. Hallman
Or look at the fame package, which has ti (TimeIndex) and tis (TimeIndexedSeries) classes that handle this kind of problem. I think it's simpler and faster than the zoo stuff, but then I would say that, since I wrote it. Jeff "stephen sefick" <[EMAIL PROTECTED]> writes: > I don't know if this wi

Re: [R] help with oop in R - class structure and syntex

2008-02-06 Thread Jeffrey J. Hallman
"tom soyer" <[EMAIL PROTECTED]> writes: > (1) how do I encapsulate the generics? i.e., if a class has 100 methods, > then does it mean 100 generics would be dumped in the global environment? > Or, is it possible to define a local environment and restrict the generics > from one class to a particula

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-18 Thread Jeffrey J. Hallman
Frank E Harrell Jr <[EMAIL PROTECTED]> writes: > Rob Robinson wrote: >> I wonder if those who complain about SAS as a programming environment have >> discovered SAS/IML which provides a programming environment akin to Matlab >> which is more than capable (at least for those problems which can be t

Re: [R] things that are difficult/impossible to do in SAS or SPSS but simple in R

2008-01-16 Thread Jeffrey J. Hallman
SAS has no facilities for date arithmetic and no easy way to build it yourself. In fact, that's the biggest problem with SAS: it stinks as a programming environment, so it's always much more difficult than it should be to do something new. As soon as you get away from the canned procs and have to

Re: [R] is it safe to replace every "<-" by "=" in R code?

2008-01-14 Thread Jeffrey J. Hallman
Jonathan Baron <[EMAIL PROTECTED]> writes: > I think it is worth pointing out that, if you use ESS with (X)emacs, > " <- " (with spaces) is produced when you type "_". It requires only two > keystrokes (shift and -), and the spaces are done for you. The = sign > requires three because you need to

Re: [R] I need arguments pro-S-PLUS and against SAS...

2008-01-07 Thread Jeffrey J. Hallman
SAS programming is easy if everything you want to do fits easily into the row-at-a-time DATA step paradigm. If it doesn't, you have to write macros, which are an abomination. DATA step statements and macros are entirely different programming languages, with one doing evaluations at "compile" time