[R] how to calculate time offset between timezones?

2008-01-10 Thread dankelley
#QUESTION# Is there a way to calculate the offset between timezones, e.g. from AST to GMT? #DETAILS# I am working with data files that use local time, and that indicate the timezone by e.g. AST (Atlantic Standard Time, my local time) in a header. I was guessing that

Re: [R] how to calculate time offset between timezones?

2008-01-10 Thread dankelley
Since designations such as AST are used in the data files that I'm parsing, I guess I'll make up a list of my own conversions, perhaps based on http://www.timeanddate.com/library/abbreviations/timezones/ (I cite this website not because I know it to be authoritative, but just in case it

Re: [R] how to add an index to a vignette?

2007-12-15 Thread dankelley
Oh, I see. The answer is just to do as usual, e.g. as follows, and R CMD build simply takes care of it. code ... \usepackage{makeidx} \makeindex ... \begin{document} ... \index{something} ... \printindex \end{document} /code -- View this message in context:

[R] how to shorten elements in a data frame?

2007-12-12 Thread dankelley
I have a data frame (res$data in the example below), and I'd like to walk through it, doing an approx() to interpolate each element in turn based on the value of the item named pressure that is in the data.frame. I've put some code below. I had hoped that the commented-out length() - line would

Re: [R] how to shorten elements in a data frame?

2007-12-12 Thread dankelley
In case anyone with a similar need comes across this thread, I am posting below a solution to my problem, in which I construct a new data frame that has the desired dimensions, instead of trying to change the dimensions of the existing data frame. code npt - length(pt) # Step

[R] strsplit on comma, with a trailing comma in input

2007-12-03 Thread dankelley
I have a comma-separated data file in which trailing commas sometimes occur. I am using strsplit to extract the data from this file, and it seems great except in cases with trailing comma characters. The example below illustrates. What I'd like is to get a fourth element in the answer, being

Re: [R] strsplit on comma, with a trailing comma in input

2007-12-03 Thread dankelley
This works perfectly. Thanks! Peter Dalgaard wrote: Hmm, I don't think strsplit can do that. However: scan(textConnection(a,,b,), sep=,, what=) Read 4 items [1] a b -- O__ Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of

[R] problem installing 2.6.1 on OSX Leopard (after failed MacPorts install)

2007-12-02 Thread dankelley
This message reports a problem, and its solution. I found the solution while posting. Since others may have the same problem, I am continuing with the post. PROBLEM I am having a different problem than the one that others have reported (e.g.