Displaying 6 results from an estimated 6 matches for "bozhou1981".
2008 Mar 02
3
elegant way to minus on each row of a matrix
How to do this in an elegant way formatrix/data frame/zoo?
mat=
1 2 3
4 5 6
7 8 9
vector=
1
2
3
result=
0 1 2
2 3 4
4 5 6
ie
1-1 2-1 3-1
4-2 5-2 6-2
7-3 8-3 9-3
Thanks in advance.
_________________________________________________________________
08
[[alternative HTML version deleted]]
2009 Feb 28
2
rgl persp3d bounding box color problem.
Hi guys,
I hit on a problem when I use rgl.
Could you try to run the code here in this link and see why the first persp3d gives a red bounding box and the second shows black?
http://rafb.net/p/g1i7ur33.html
(sorry for not pasting the code here directly but my previous email got filtered by this list so I suspect my code looks like spam to the spam filter)
I'm expecting black color to be
2008 Feb 17
1
How to make a vector/list/array of POSIXlt object?
Hi Guys,
I'm cooking up my time series code. I want a data frame with first column as timestamp in POSIXlt format.
I hit on this the problem of how to create an array/list/vector of POSIXlt objects. Code is as follows
> dtt=array(dim = 2)
> t=as.POSIXlt( strptime("07/12/07 13:20:01", "%m/%d/%Y %H:%M:%S",tz="GMT"))
> dtt
[1] NA NA
> t
[1]
2008 Mar 02
1
Idioms for a timeseries operation - moving window
Hi Guys,
Need your wisdom on this.
Say I have a time series (in zoo format) like this
> x <- zoo(11:21)
> x
1 2 3 4 5 6 7 8 9 10 11
11 12 13 14 15 16 17 18 19 20 21
I want to do a "moving window sampling" of it. The result can either be a matrix or a dataframe like this
my.super.moving.window(x, length=3, by=1)
11 12 13
12 13 14
13 14 15
14 15 16
....
18 19 20
2008 Mar 02
1
question on lag.zoo
Hi Guys,
I'm using zoo package now. I found lag is not doing what I assumed.
> x <- zoo(11:21)
> z <- zoo(1:10, yearqtr(seq(1959.25, 1961.5, by = 0.25)), frequency = 4)
> x
1 2 3 4 5 6 7 8 9 10 11
11 12 13 14 15 16 17 18 19 20 21
> lag(x)
1 2 3 4 5 6 7 8 9 10
12 13 14 15 16 17 18 19 20 21
> z
1959 Q2 1959 Q3 1959 Q4 1960 Q1 1960 Q2 1960 Q3 1960 Q4
2008 Feb 16
3
Arithmetic bug? (found when use POSIXct) (PR#10776)
Full_Name: Bo Zhou
Version: 2.6.1 (2007-11-26)
OS: Windows XP
Submission from: (NULL) (207.237.54.242)
Hi,
I found an arithmetic problem when I'm doing something with POSIXct
The code to reproduce it is as follows (This is the recommended way of finding
out time zone difference on R News 2004-1 Page 32 URL
http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf)
a=Sys.time()