Skip to content
Prev 312284 / 398506 Next

hhmm time format, strptime and %k

Try this  (prepend leading zero in some cases)
+ 1 11/19/2012  935 137.89 138.06 137.82 138.05 3202541 3013215       0
+ 2 11/19/2012  940 138.04 138.40 138.02 138.38 2549660 2107595 4657255
+ 3 11/19/2012  945 138.38 138.40 138.18 138.19 1627379 1856318 3483697
+ 4 11/19/2012  950 138.20 138.32 138.20 138.30 1046133  896423 1942556
+ 5 11/19/2012  955 138.30 138.49 138.30 138.41 1287646  961604 2249250
+ 6 11/19/2012 1000 138.41 138.49 138.39 138.43  806043  731641 1537684"
+     , header = TRUE
+     , as.is = TRUE
+     )
Date Time   Open   High    Low  Close      Up    Down  Volume
           newTime
1 11/19/2012 0935 137.89 138.06 137.82 138.05 3202541 3013215       0
2012-11-19 09:35:00
2 11/19/2012 0940 138.04 138.40 138.02 138.38 2549660 2107595 4657255
2012-11-19 09:40:00
3 11/19/2012 0945 138.38 138.40 138.18 138.19 1627379 1856318 3483697
2012-11-19 09:45:00
4 11/19/2012 0950 138.20 138.32 138.20 138.30 1046133  896423 1942556
2012-11-19 09:50:00
5 11/19/2012 0955 138.30 138.49 138.30 138.41 1287646  961604 2249250
2012-11-19 09:55:00
6 11/19/2012 1000 138.41 138.49 138.39 138.43  806043  731641 1537684
2012-11-19 10:00:00

        
On Wed, Nov 28, 2012 at 4:02 PM, Costas Vorlow <costas.vorlow at gmail.com> wrote: