Skip to content

Problem with Median

9 messages · Suhaila Haji Mohd Hussin, Gabor Grothendieck

3 days later
#
On Sun, May 13, 2012 at 5:02 AM, Suhaila Haji Mohd Hussin
<bell_beauty12 at hotmail.com> wrote:
The dput output seems to have gotten messed up in transmission so lets
use an artificial example:

set.seed(123)
DF <- as.data.frame(matrix(rnorm(600), nc = 12)) # 12 columns
p <- prcomp(DF)

# error - cannot plot more than 10
plot.ts(p$x)

# try it several ways with plot.zoo

library(zoo)
plot(as.zoo(p$x)) # ok

# or - all on one panel

k <- ncol(p$x)
plot(as.zoo(p$x), screen = 1, col = 1:k)

# or - 1st two on 1st panel, 2nd two on 2nd panel, etc.

plot(as.zoo(p$x), screen = seq(0, len = k) %/% 2, col = 1:2)