On 01/10/2015 11:29 PM, Rolf Turner wrote:> On 02/10/15 15:47, David Winsemius wrote: > > <SNIP> > >> On Oct 1, 2015, at 6:22 PM, Rolf Turner wrote: >>> >>> P.S. I have been unable to find a corresponding vector of the names >>> of the days of the week, although I have a very vague recollection >>> of the existence of such a vector. Does it exist, and if so what >>> is it called? >> >> It's could called up by strptime because it is mapped to a character >> vector by the internationalization database: >> >>> format( as.Date(1:7)+2, format="%A") >> [1] "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" >> "Friday" [7] "Saturday" > > <SNIP> > > When I try that (copying and pasting your code so that there's no chance > of fumble-fingering) I get: > >> Error in as.Date.numeric(1:7) : 'origin' must be supplied > > Why do these things always happen to *me*???The zoo package replaces as.Date.numeric() with a function that assumes an origin of "1970-01-01". There may be other packages that also make a replacement like this. David appears to have one of them attached, and you don't. Duncan Murdoch
On Oct 2, 2015, at 2:33 AM, Duncan Murdoch wrote:> On 01/10/2015 11:29 PM, Rolf Turner wrote: >> On 02/10/15 15:47, David Winsemius wrote: >> >> <SNIP> >> >>> On Oct 1, 2015, at 6:22 PM, Rolf Turner wrote: >>>> >>>> P.S. I have been unable to find a corresponding vector of the names >>>> of the days of the week, although I have a very vague recollection >>>> of the existence of such a vector. Does it exist, and if so what >>>> is it called? >>> >>> It's could called up by strptime because it is mapped to a character >>> vector by the internationalization database: >>> >>>> format( as.Date(1:7)+2, format="%A") >>> [1] "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" >>> "Friday" [7] "Saturday" >> >> <SNIP> >> >> When I try that (copying and pasting your code so that there's no chance >> of fumble-fingering) I get: >> >>> Error in as.Date.numeric(1:7) : 'origin' must be supplied >> >> Why do these things always happen to *me*??? > > The zoo package replaces as.Date.numeric() with a function that assumes > an origin of "1970-01-01". There may be other packages that also make a > replacement like this. David appears to have one of them attached, and > you don't.Quite right, Duncan. I failed to include the <environment: namespace:zoo> even though it was staring me in the face. My wife says I have an extreme case of "refrigerator blindness" which now seems to be spreading to other areas of my cognitive activities. Sorry, Rolf. -- David.> > Duncan Murdoch >David Winsemius Alameda, CA, USA
On 03/10/15 04:42, David Winsemius wrote:> > On Oct 2, 2015, at 2:33 AM, Duncan Murdoch wrote:<SNIP>>> The zoo package replaces as.Date.numeric() with a function that >> assumes an origin of "1970-01-01". There may be other packages >> that also make a replacement like this. David appears to have one >> of them attached, and you don't. > > Quite right, Duncan. I failed to include the <environment: > namespace:zoo> even though it was staring me in the face. My wife > says I have an extreme case of "refrigerator blindness" which now > seems to be spreading to other areas of my cognitive activities. > > Sorry, Rolf.Quite alright. The syndrome is *very* familiar to me! :-) cheers, Rolf -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276