Skip to content
Back to formatted view

Raw Message

Message-ID: <1351881718001-4648258.post@n4.nabble.com>
Date: 2012-11-02T18:41:58Z
From: veepsirtt
Subject: Date format conversion from "2012-09-20" to  "2012:09:20"
In-Reply-To: <1348144428546-4643725.post@n4.nabble.com>

Hi R,
How to get the range of values form startDate to lastDate as given below?.

#*****************************************************************
# Load historical data
#****************************************************************** 
library('quantmod')
endDate =Sys.Date()
startDate = as.Date(endDate-30, order="ymd")

dataspy = getSymbols("SPY", from = startDate, to=endDate, auto.assign =
FALSE)
lastDate=startDate+5

#subset first 5 days
dataspy['startDate::lastDate']
print(dataspy)

Thanks
veepsirtt




--
View this message in context: http://r.789695.n4.nabble.com/Date-format-conversion-from-2012-09-20-to-2012-09-20-tp4643710p4648258.html
Sent from the R help mailing list archive at Nabble.com.