[R] Best method to add unit information to dataframe ?

2011-10-03 Thread bruno Piguet
Dear all, I'd like to have a dataframe store information about the units of the data it contains. You'll find below a minimal exemple of the way I do, so far. I add a "units" attribute to the dataframe. But I dont' like the long syntax needed to access to the unit of a given variable (namely

Re: [R] Match() on raw objects ?

2010-07-28 Thread bruno Piguet
On Tue, 27 Jul 2010, Prof Brian Ripley wrote : > > Note that raw values in R are really intended to be passed around and not > manipulated: if you do much of the latter, coercing to integer, say, is > likely to be much more efficient. > > Indeed : I tried a minimal benchmark : a <- charToRaw(pas

Re: [R] message box

2010-07-28 Thread bruno Piguet
Martin du Saire asked : > > I need some help figuring out how to make a pop-up message box appear with > error messages when running a script using Rterm. Windows XP R2.10.1 > Have you tried the examplescompiled by James

Re: [R] Match() on raw objects ?

2010-07-27 Thread bruno Piguet
on 2010/7/27, Prof Brian Ripley wrote : > >OK. Had I tried "02", it would have worked, but only by chance. >> > > No, not 'by chance': that is what the help page for match() tells you > happens. Well, i mean that *I* would have typed "02" by chance. I read, but didn't fully understand the

Re: [R] Match() on raw objects ?

2010-07-27 Thread bruno Piguet
Dear Prof Ripley, You wrote : > You failed to supply a raw value to match, and if you do it works: > > match(as.raw(2), a) >> > [1] 9 > > for the ninth value is *not* '2, indeed': it is as.raw(2). > Thanks for the clarification. I think you are confusing R objects with their printed representa

[R] Match() on raw objects ?

2010-07-27 Thread bruno Piguet
Dear all, Sorry to bother you with a question that must be a FAQ, but I'm not clever enough to have Google give me the answer. I want to filter out some bytes that I read in a file, before applying rawToChar (to prevent null character problems) So, I tried things like match("", my_raw_t

[R] Fwd: Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-29 Thread bruno Piguet
[I replied to Gabor only, I think i may be interesting to cc the list, for the record.] -- Forwarded message -- From: bruno Piguet Date: 2010/6/29 Subject: Re: [R] Fast and simple tool for re-sampling of asynchronous time series ? To: Gabor Grothendieck 2010/6/25 Gabor

[R] Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-25 Thread bruno Piguet
Hi all, I'm looking for a function which could do some fast and simple re-sampling of asynchronous time series. Below is a MCE of the kind of algorithm I need. As you can see, it's quite crude, but it's enough for my current needs. The only problem is that it is quite slow on real use case

[R] A fast version of ccf () accepting missing values ?

2009-07-03 Thread bruno Piguet
Dear R-Helpers, I need to compute cross-correlation on two signals wich may contain missing values. One cannot pass "Na.action=na.pass" to the ccf() function. So, I wrote a naive function of my own (see below). Unsurprisingly, this function is not very fast. Do you think that it is po