Displaying 2 results from an estimated 2 matches for "closedata".
Did you mean:
close_data
2000 Jul 07
1
reorganizing a data frame
...HIT 71.125
7 01/05/1998 HIT 72.313
8 01/06/1998 HIT 72.563
9 01/02/1998 INTC 36.313
10 01/05/1998 INTC 37.250
11 01/06/1998 INTC 36.563
12 01/07/1998 INTC 36.375
13 01/08/1998 INTC 37.156
I would like to turn this data frame into a matrix, closedata, that looks like
this
GE HIT INTC
01/02/1998 24.667 71.125 36.313
01/05/1998 25.104 72.313 37.250
01/06/1998 24.771 72.563 36.563
01/07/1998 24.979 NA 36.375
01/08/1998 24.750 NA 37.156...
2009 Aug 03
3
Help with data type
Hi there,
Using a quantmod function, I calculate the daily change between two points
in a time series. However, I don't think I am using the data correctly.
Code:
getSymbols("^GSPC", src="yahoo")
CloseData <- Cl(GSPC)
Delta <- diff(CloseData, lag=1)
for (i in 3:length(Delta)) {
if (Delta[i]>Delta[i-1]) sum <- sum + Delta
}
I can't seem to use the Delta variable. Can anyone point me in the right
direction to transform the variable into a usable one?
Example:
> Delta[i-1]...