I have and XTS time series object that has date and time. I started with 1
minute data and used apply.daily(x, sum) to sum the data to one cumulative
value. This function works just fine however it leaves a time for the last
summed value which looks like this 2006-07-19 14:58:00. I need to just
I'm calling a list of symbols and then using a function to build a data
frame from that symbol list. It works great until I introduce this index
symbol from yahoo '^GSPC'. When and index symbol is introduced I get and
error which is below.
Data - symbolFrame(symbols)
Error in get(S) :
I have a time series data with 1's and 0's. When the last 3 observations
are 1 I want to generate a 1 until I have three 0's in a row and then I want
it to produce all zeros again. For example if I have 0101010101 for the
first part of the time series this would produce all zeros. Then if the
I have loaded price data for GE and then calculated a 50 day simple moving
average. Then I have a created a ifelse statement that produce a 1 when
GE's closing price is above the simple moving average and a 0 when GE
Closing price is below the 50 day simple moving average.
However, what I
I have a xts object made of daily closing prices I have acquired using
quantmod.
Here is my code:
library(xts)
library(quantmod)
library(lubridate)
# Gets SPY data
getSymbols(SPY)
# Subset Prices to just closing price
SP500 - Cl(SPY)
# Show day of the week for each date using 2-6
I used quantmod to pull in price data from the ticker SPY. The data has
date and closing price. I would like to show the day of the week for each
closing price. Is that possible? Also, I would like to add the back into
the data frame in a new column without changing the structure of the data
6 matches
Mail list logo