I have a set of data from historical stock prices for publicly traded companies on the NASDAQ and NYSE. I've used the following code to download data on Amazon's stock price and get the times the data was sampled.
library(quantmod)
amzn <- getSymbols("AMZN",auto.assign=FALSE)
sampleTimes <- index(amzn)
Then I used grepl to get a count of how many values were collected in 2012. Now I need to get a count of how many of those values occurred on Mondays.
I've tried several different approaches, but none has been effective. I'm thinking that the lubridate package should be useful, but I can't figure out just how. POSIXlt should also be helpful, but I also can't think of an effective way to use it.
This must be a very simple problem, but I can't seem to wrap my brain around it.
Please help.