Displaying 20 results from an estimated 100 matches similar to: "conversion of time"
2024 Oct 10
1
Typo in DateTimeClasses.Rd
Hello,
When following a thread that started today [1], I read the documentation
for DateTimeClasses {base} more carefully and noticed a typo in the
"Details on POSIXlt" section, in the paragraph right after the
components list.
The original and corrected are "he" instead of "the".
From earlier versions of R, he last two components will not be present
for
2012 Dec 06
1
Incorrect DST time changes in DateTimeClasses
Can anyone please shed any light on why R DateTimeClasses give weird times for when daylight saving time information changes, and which aren't consistent with the OS?
Example:
Expected result: in New Zealand DST stopped (NZDT -> NZST) at 03:00 NZDT on 2010-04-04, as confirmed by the OS time zone info (OS X 10.8.2):
zdump -v /etc/localtime
/etc/localtime Sat Apr 3 13:59:59 2010 UTC
2009 Nov 19
0
In the documentation of 'Ops.Date', please remove mention about "difftime", like in the documentation of 'DateTimeClasses' (PR#14072)
I am sorry to reply. But I need to clarify things.=0A=0AFrom searching over=
the internet, I know that, before R 2.5.0, in the documentation of 'DateTi=
meClasses', in 'date + x', in the explanation about 'x', there is also ment=
ion that 'x' can be a 'difftime' object. Now, it has been removed.=0A=0AWhy=
not doing the same in the documentation of
2024 Oct 10
0
Typo in DateTimeClasses.Rd
Hello,
In my previous e-mail I forgot the link to the thread I mention.
[1] https://stat.ethz.ch/pipermail/r-help/2024-October/480098.html
Sorry for the mess,
Rui Barradas
--
Este e-mail foi analisado pelo software antiv?rus AVG para verificar a presen?a de v?rus.
www.avg.com
2002 Feb 13
2
formatting date strings
Hi all
I am a relatively new R user so please excuse this question if it has been
covered some where else, just tell me where to find it.
I have a simulation model that out puts dates in a standard dd/mm/yy format
R reads this as a factor and I cant find anything that will allow me to
convert them to a date. In S+ I have used a chron() function that required
you to specify the format of the
2005 Nov 23
3
date/time arithmetic
On the help page "DateTimeClasses {base}" it says:
"One can add or subtract a number of seconds or a difftime object
from a date-time object, but not add two date-time objects."
However,
> x<-Sys.time(); y<-Sys.time()+3600
> diff<-y-x
> x; y; diff
[1] "2005-11-23 19:58:20 GMT"
[1] "2005-11-23 20:58:20 GMT"
Time difference of 1 hours
2007 Jan 04
2
Seek general information about time/date storage and functions in R
Hello R List -
I have to import Excel files (either as .csv files or using RODBC) into
R (2.4.1, Windows) and operate on dates and times (e.g. find minutes
between times, change dates to days of week or analyze by weeks of
year). The help files for format.Date, strptime, as.POSIX,
DateTimeClasses, etc. etc. are informative but perhaps a little terse.
I have googled unsuccessfully for a more
2009 May 20
2
Class for time of day?
What is the recommended class for time of day (independent of calendar
date)?
And what is the recommended way to get the time of day from a POSIXct
object? (Not a string representation, but a computable representation.)
I have looked in the man page for DateTimeClasses, in the Time Series
Analysis Task View and in Spector's Data Manipulation book but haven't found
these. Clearly I can
2005 Jan 31
4
aggregating dates
I have a frame which contains 3 columns:
"date" "defectnum" "state"
And I want to get the most recent state change for a given defect number. date is POSIXct.
I have tried:
aggregate(ev$date, by=list(ev$defectnum), max)
Which appears to be working except that the dates seem to come back as integers (presumably the internal representation of POSIXct).
When I
2020 Apr 06
2
Help useRs to use R's own Time/Date objects more efficiently
> (1) Create a top-level help page with a title like "Date and Time
> Classes" to give a brief but general overview. This would mean the
> existing DateTimeClasses would need a new title.
I wanted to modify my first suggestion.
Perhaps a better idea would be to reference an external document
giving an overview of the subject.
I couldn't find a discussion of POSIXct/POSIXlt
2011 Oct 05
2
any way to convert back to DateTime class when "accidental" conversion to numeric?
Hi,
In short, I would like to know if there is any way to convert a numeric
into a date, similar to how strptime() can convert a string to a date time
class?
There are some functions, etc. which don't work well with dates, and
tend to force them into numerics. I understand that the number it spits
back is the number of seconds since the beginning of 1970 (see the first few
sentences
2020 Apr 04
5
Help useRs to use R's own Time/Date objects more efficiently
This is mostly a RFC [but *not* about the many extra packages, please..]:
Noticing to my chagrin how my students work in a project,
googling for R code and cut'n'pasting stuff together, accumulating
this and that package on the way all just for simple daily time series
(though with partly missing parts),
using chron, zoo, lubridate, ... all for things that are very
easy in base R *IF*
2004 Mar 01
6
Find out the day of week for a chron object?
I know that this is correct:
library(chron)
x = dates("01-03-04", format="d-m-y", out.format="day mon year")
print(x)
It gives me the string "01 Mar 2004" which is correct.
I also know that I can say:
print(day.of.week(3,1,2004))
in which case he says 1, for today is monday.
My question is: How do I combine these two!? :-) I have a
2007 Mar 19
3
R4.1: seq.POSIXt, tz="AEST" (PR#9572)
Times from seq.POSIXt come out wrong in AEST timezone around Feb 29 every
leap year before 1970 (on Windows XP).
According to help(DateTimeClasses), this is handled by "our own C code".
> x <- as.POSIXct("1968-02-27") # tz="AEST"
> x.gmt <- as.POSIXct("1968-02-27", tz="GMT")
> data.frame(
GMT=seq(x.gmt, by="day",
2016 Dec 15
2
print.POSIXct doesn't seem to use tz argument, as per its example
On the documentation page for DateTimeClasses, in the Examples section,
there are the following two lines:
format(.leap.seconds) # the leap seconds in your time zone
print(.leap.seconds, tz = "PST8PDT") # and in Seattle's
The second line (using print) seems to ignore the tz argument, and prints
the dates in my time zone, while:
format(.leap.seconds, tz =
2007 Feb 21
1
Adding difftime objects to POSIXt objects
Hello,
?DateTimeClasses states that "one can add or subtract a number of
seconds or a 'difftime' object from a date-time object, but not add two
date-time objects."
So, is the below expected behavior?
> x <- Sys.time()
> x
[1] "2007-02-21 16:19:56 CST"
> x + as.difftime("1","%H")
[1] "2007-02-21 16:19:57 CST"
Warning
2007 Oct 08
2
Incompatible methods ("-.POSIXt", "Ops.difftime") for "-"
Dear all,
according to the Help-page of DateTimeClasses {base} I should be able to do
time - z
with
time date-time objects
z a numeric vector (in seconds) or an object of class "difftime".
However, on R version 2.6.0 (Windows XP) I get
> Sys.time() - as.difftime(c("0:3:20", "11:23:15"))
Time differences in mins
[1] 1191837998 1191837318
2003 Oct 20
1
controling x-labels in xyplot (lattice) when x is POSIX object
Hi,
V1.8.0 seems to allow DateTimeClasses as the x argument in xyplots (lattice).
For example:
x <- seq.POSIXt(strptime("2003/01/01", format = "%Y/%m/%d"),
strptime("2003/10/01", format = "%Y/%m/%d"), by = "month")
y <- rnorm(length(x))
dat <- data.frame(x= x, y = y)
xyplot(y ~ x, data = dat, type = "b")
2004 Aug 09
1
Time zones
I am analysing some data collected over a number of months from Allentown,
PA, which is just north of Philadelphia. I am using as.POSIXct for dates
and times, and I need to get the timezone specification correct.
Going on the documentation for DateTimeClasses, I believe one way to
specify the correct time zone is
tz="EST5EDT"
I would be grateful for any advice on this. I ask
2020 Apr 05
0
Help useRs to use R's own Time/Date objects more efficiently
I think POSIXct and POSIXlt are badly-chosen names.
The name "POSIX" implies UNIX.
(i.e. XYZix operating system is mostly POSIX compliant... Woo-Hoo!).
My assumption is that most people modelling industrial/econometric
data etc, or data imported from databases, don't want system
references everywhere.
Historically, I've use the principle that:
If programming language A uses