[R] Computing Time Intervals On A Series

2009-07-03 Thread rory . winston
Hi I have a dataset that looks like this (dput'd below): > head(x, 20) time status 1 2009-07-02 10:32:37 1 2 2009-07-02 10:32:43 0 3 2009-07-02 10:32:43 1 4 2009-07-02 10:32:44 0 5 2009-07-02 10:32:44 1 6 2009-07-02 10:32:48 0 7 2009-07-02 10:32:48 1 8 2009-07-02 10:32:54 0 9 2009-07-02 10:33:04

[R] Correlation Network Diagram - Correction

2009-07-03 Thread rory . winston
Sorry - In my previous mail, I said page 39, when I actually meant page 36. Cheers -- Rory [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide h

[R] Correlation Network Diagram?

2009-07-03 Thread rory . winston
Hi all On page 39 of this paper [1] by Andrew Lo there is a very interesting correlation network diagram (sorry I dont have a more convenient link to the type of diagram I'm talking about). does anyone know of any package in R that can generate these types of diagrams? Cheers -- Rory [1] h

[R] Merging Irregular Time Series With NAs

2009-06-23 Thread rory . winston
Hi I have two irregular time series, which are of different lengths and being and end at different times. For the common subset of time that they both span, they should have the same values, but the values may occur at slightly different time intervals. I am trying to "line up" the identical

[R] Indexing Arbitrary Time Intervals in zoo Series

2009-06-16 Thread rory . winston
Hi guys Does anyone know if it is possible to index a zoo series by a sequence? For instance, with the following irregular zoo object, I can calculate the range of its time-based index: > r <- range(index(l.zoo)) > r [1] "2009-06-15 01:44:20.802 GMT" "2009-06-15 16:54:24.124 GMT" If I just w

Re: [R] Chron / zoo index problem

2009-06-16 Thread rory . winston
Thanks Gabor - I'll check it out. Actually I just realised I can also do what I am looking for in a ridiculously simple manner (as the data I have is intra-day): aggregate(l.zoo, hours(index(l.zoo)), mean) Cheers -- Rory On Jun 16, 2009 2:46pm, Gabor Grothendieck wrote: > See R News 4/1.

[R] Chron / zoo index problem

2009-06-16 Thread rory . winston
Hi all I have an irregular zoo series, where the time index looks like the following: > head(time(l.zoo)) [1] "2009-06-15 01:44:20.802 GMT" "2009-06-15 01:44:20.812 GMT" "2009-06-15 01:44:20.837 GMT" "2009-06-15 01:44:20.848 GMT" "2009-06-15 06:00:01.320 GMT" [6] "2009-06-15 06:00:01.330 G

[R] Finding Longest Identical Subsequence across Multiple Time Series?

2009-05-29 Thread Rory Winston
Hi all Does anyone here know of an efficient algorithm to find the longest identical subsequence across multiple time series? Say I have two time series A and B (not necessarily of identical length), and I wish to find the beginning and ending index of the longest common subsequence across both se

Re: [R] zoo and coredata() classes

2009-03-03 Thread rory . winston
Thanks Gabor. Using the data.matrix() approach as outlined in the FAQ works for me. Cheers Rory On Mar 3, 2009 4:00pm, Gabor Grothendieck wrote: > On Tue, Mar 3, 2009 at 10:37 AM, rory.wins...@gmail.com> wrote: > > Hi guys > > > > I have a reasonably basic question with zoo usage, but I hav

[R] zoo and coredata() classes

2009-03-03 Thread rory . winston
Hi guys I have a reasonably basic question with zoo usage, but I havent been able to find a satisfactory workaround yet. Heres a simple example of what I'm talking about (the following data frame contains numeric columns that contains NAs): > head(ebs) time src tstamp code bid ask 1 2009-03-

Re: [R] Computational Probability

2008-12-26 Thread Rory Winston
thias > > Prof Brian Ripley wrote: > >> Look at packages distr* : they can do your example and might do what your >> real applications. >> >> On Fri, 26 Dec 2008, Rory Winston wrote: >> >> Hi >>> >>> Firstly , happy Christmas to R-Help! Sec

[R] Computational Probability

2008-12-26 Thread Rory Winston
Hi Firstly , happy Christmas to R-Help! Secondly, I wonder if anyone can help me with the following query: I am trying to reproduce some explicit probability calculations performed in APPL (a Maple extension for computational probability). For instance, in APPL, to compute the probability that the

Re: [R] Plotting Prediction Surface with persp()

2008-07-03 Thread rory . winston
Great! Thanks for the advice. Cheers Rory --Original Message-- From: Duncan Murdoch To: Rory Winston Cc: r-help@r-project.org Sent: 3 Jul 2008 05:08 Subject: Re: [R] Plotting Prediction Surface with persp() On 02/07/2008 8:47 PM, Rory Winston wrote: > Hi all > > I have a quest

[R] Plotting Prediction Surface with persp()

2008-07-02 Thread Rory Winston
Hi all I have a question about correct usage of persp(). I have a simple neural net-based XOR example, as follows: library(nnet) xor.data <- data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0))) names(xor.data) <- c("x","y","o") xor.nn <- nnet(o ~ x + y, data=xor.data, linout=FALSE, size=1)

Re: [R] Adding a Rotated Density Plot to an Existing Plot

2008-06-08 Thread Rory Winston
y$x, type='l',ylim=c(0.5,4)) On Sun, Jun 8, 2008 at 7:07 AM, Rory Winston <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: Hi Consider the following graph: x <- rnorm(1000) x <- x + exp(-x/2) layout(matrix(rep(c(1,1,2), 2), 2, 3, byrow=T

[R] Adding a Rotated Density Plot to an Existing Plot

2008-06-08 Thread Rory Winston
Hi Consider the following graph: x <- rnorm(1000) x <- x + exp(-x/2) layout(matrix(rep(c(1,1,2), 2), 2, 3, byrow=TRUE)) boxplot(x) rug(jitter(x), side=2) plot(density(x)) What I would really like to do is to have the density plot rotated by 90 degrees so that I can see it line up with the rug

[R] Vector Product question

2008-05-25 Thread Rory Winston
Hi Ive looked around but I cant figure out how to do this without a for loop. I have a vector of neural net weights from coef.nnet(), which looks like c(3,3,1). I also have a list of weight prefixes, which are c("x","h","y"). I would like to obtain a vector that looks like c("x1","x2","x3","h

[R] Matrix Indexing

2008-04-12 Thread Rory Winston
Hi Does anyone know how I might pick out diagonal elements of a matrix using a vector? If I create a matrix a: a <- matrix(c(1:16), 4, byrow=TRUE) and I want to pick out the elements (1,1),(2,2),(3,3), or another arbitrary diagonal (upper or lower), is there any way I can use a vector to do thi

Re: [R] Arbitrary Precision Numbers

2008-04-10 Thread Rory Winston
Thanks Earl Thats exactly what I was looking for - an extension that uses libgmp and provides a bignum type that can be combined with standard operators and numeric variables. Somehow my original search on CRAN missed this one. Cheers Rory Earl F. Glynn wrote: > > "Rory Winst

[R] Arbitrary Precision Numbers

2008-04-04 Thread Rory Winston
Hi (If you're wondering, this is a Project Euler question :)) If I wanted to calculate the sum of the digits in the decimal representation of 2^1000, what would be a good way to go about that? I've tried the following methods: # Calculate the sum of digits in the decimal representation of 2^n

Re: [R] UNSOLITED E_MAILS: Integrate R data-analysis projects with Microsoft Office for free

2008-03-19 Thread Rory Winston
Me too. Getting directly spammed like this is really annoying. I dont mind a general post to the list, but individually spamming each member of the list is unacceptable. Especially as I have no interest in the stupid product in question. Gorden T Jemwa wrote: > > Dear R Admins, > > I received

Re: [R] Changing size of lattice plot?

2007-10-29 Thread Rory Winston
Sorry, I should have specified: windows(height=y, width=x) works for the general caseand specifying <<...width=x, height=y>>= to Sweave works perfectly. Thank you! Cheers Rory On 10/29/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > > On Mon, 29 Oct 2007, Rory Wi

Re: [R] Changing size of lattice plot?

2007-10-29 Thread Rory Winston
ion for this, or do I need to manually call pdf() and \includegraphics here? Thanks Rory On 10/29/07, Rory Winston <[EMAIL PROTECTED]> wrote: > > Hi > > I am having a bit of difficulty with changing the canvas size on a > trellis/lattice plot. I am plotting two "cubes&

[R] Changing size of lattice plot?

2007-10-29 Thread Rory Winston
Hi I am having a bit of difficulty with changing the canvas size on a trellis/lattice plot. I am plotting two "cubes" of 3-dimensional random numbers, as follows: library(gsl) library(lattice) q <- qrng_alloc(type="sobol", 3) npoints <- 200 rs <- qrng_get(q,npoints) # Plot the normal variates in