Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-03-05 Thread William Dunlap
r-help-boun...@r-project.org] On > Behalf Of ikuzar > Sent: Monday, March 05, 2012 6:42 AM > To: r-help@r-project.org > Subject: Re: [R] strange behaviour of "POSIXlt" "POSIXt" object > > Hi, > I'd like to know what "L" means in "1L&quo

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-03-05 Thread R. Michael Weylandt
It means to interpret the literal as an integer rather than a double. Michael On Mar 5, 2012, at 9:41 AM, ikuzar wrote: > Hi, > I'd like to know what "L" means in "1L" in the instruction below: > for(i in 1:20){ z$mday <- z$mday + 1L ; cat(is.na(z), ": ");print(z)} > > The result : > FALSE

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-03-05 Thread ikuzar
Hi, I'd like to know what "L" means in "1L" in the instruction below: for(i in 1:20){ z$mday <- z$mday + 1L ; cat(is.na(z), ": ");print(z)} The result : FALSE : [1] "2009-02-26 06:30:00" FALSE : [1] "2009-02-27 06:30:00" FALSE : [1] "2009-02-28 06:30:00" FALSE : [1] "2009-03-01 06:30:00" FALSE :

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-02-27 Thread R. Michael Weylandt
Hadley's lubridate package might be of some help to you. Michael On Mon, Feb 27, 2012 at 11:40 AM, ikuzar wrote: > So, how is the correct way to increment the day ? > > -- > View this message in context: > http://r.789695.n4.nabble.com/strange-behaviour-of-POSIXlt-POSIXt-object-tp4418115p442520

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-02-27 Thread ikuzar
So, how is the correct way to increment the day ? -- View this message in context: http://r.789695.n4.nabble.com/strange-behaviour-of-POSIXlt-POSIXt-object-tp4418115p4425206.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-proj

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-02-27 Thread William Dunlap
0" TRUE : [1] "2009-03-16 06:30:00" TRUE : [1] "2009-03-17 06:30:00" The print routine does not seem to consult is.na(). Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun.

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-02-27 Thread ikuzar
Hi, I do not know what part of my code should I post here (I use large size of data, the loop "for" contains many lines). The situation is difficult to post here, but I hope these lines would be useful for help: hcEndDateTmp = userDateStart if((hcStartTime<="23:59") & (hcEndTime >= "00:00")){

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-02-24 Thread jim holtman
What version of R are you using. Here is the results with 2.14.1 under Windows: > x <- as.POSIXlt("2009-03-29 06:30:00") > > x [1] "2009-03-29 06:30:00" > class(x) [1] "POSIXlt" "POSIXt" > is.na(x) [1] FALSE > On Fri, Feb 24, 2012 at 12:57 PM, ikuzar wrote: > Hi, > Does anybody know why get I

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-02-24 Thread Curt Seeliger
> Does anybody know why get I this kind of strange situation: > > Browse[2]> hcEnd > [1] "2009-03-29 06:30:00" > Browse[2]> class(hcEnd) > [1] "POSIXlt" "POSIXt" > Browse[2]> is.na(hcEnd) > [1] TRUE pp<-as.POSIXlt("2009-03-29 06:30:00") pp [1] "2009-03-29 06:30:00" class(pp) [1] "POSIXlt" "POSIX

Re: [R] strange behaviour of "POSIXlt" "POSIXt" object

2012-02-24 Thread R. Michael Weylandt
Can you dput(hcEnd) and give a snippet of the code that generates it? Michael On Feb 24, 2012, at 12:57 PM, ikuzar wrote: > Hi, > Does anybody know why get I this kind of strange situation: > > Browse[2]> hcEnd > [1] "2009-03-29 06:30:00" > Browse[2]> class(hcEnd) > [1] "POSIXlt" "POSIXt" >