similar to: Using POSIX?t rather than "chron" or "date"

Displaying 20 results from an estimated 10000 matches similar to: "Using POSIX?t rather than "chron" or "date""

2006 Jul 14
2
chron vs. POSIX
Hi, One of the big decisions when writing code is how to handle dates and times. Gabor Grothendieck provided an excellent overview of the issue in his R News 4/1 (2004) article, and many users and developers are probably using it as a guide. The proposed guideline is to use the simplest class required; as Gabor put it "use Date if possible, otherwise use chron, and otherwise use
2003 Nov 12
3
Chron, as.POSIXct problem
Dear R list, I noticed the following 'problem' when changing the format of dates created with seq.dates() (from the Chron library) using as.POSIXct() (R 1.8.0 on OSX 10.2.8): > datesTest<-seq.dates(from="10/01/1952", length=3, by="days"); > datesTest [1] 10/01/52 10/02/52 10/03/52 # Now changing the format to show year as 1952. >
2003 Dec 04
5
Processing calendar dates with R
I am a beginner in R with a background in SAS. Are there built-in R methods of reading dates for calculating elapsed days between two calendar dates? If so, are there any examples I can browse? Thanks in anticipation. John Byrne. Lecturer in Information Systems. Australian Catholic University.
2003 Oct 17
7
datetime data and plotting
If I take the following simple data: YEAR MONTH DAY WEIGHT.KG 2003 10 6 1.2 2003 10 12 1.2 2003 10 16 1.3 and format the date data and plot it: dates <- strptime(paste(DAY,MONTH,YEAR),"%d%m%Y") plot(c(min(dates),max(dates)),c(0,max(WEIGHT.KG)), xlab="Date",ylab="Weight (kg)",type="n") lines(dates,WEIGHT.KG) points(dates,WEIGHT.KG) I find that the
2004 Apr 29
1
Entering times around the start of daylight savings time
I'm having problems entering dates and times around when daylight savings time starts. If I type (on R 1.8.1 on Gentoo Linux) > ISOdatetime(2004,4,4,0:4,0,0,"GMT") [1] "2004-04-03 19:00:00 EST" "2004-04-03 20:00:00 EST" [3] "2004-04-03 22:00:00 EST" "2004-04-03 22:00:00 EST" [5] "2004-04-03 23:00:00 EST" Giving the times
2004 Mar 05
3
as.POSIXct problem
Hi all, I'm having difficulty converting a 'dates' object to a POSIXct object: testDATES<-c(35947,35971,36004,36008,36053,36066) testDATES<-chron(dates=testDATES, format = c(dates = "m/d/y"), origin=c(month = 12, day = 30, year = 1899)) >[1] 06/01/98 06/25/98 07/28/98 08/01/98 09/15/98 09/28/98 > as.POSIXct(testDATES) [1] NA NA NA NA NA NA
2004 Apr 22
3
POSIXct vs Dates
I noticed the addition of the Dates class for dates without times, in R 1.9. I am making extensive use of POSIXct at present and would like to know whether it is worth changing to Dates. What are a few of the trade-offs? Thanks, Frank --- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
2009 Jan 04
1
POSIXct and chron issues with tz
Dear All- I am trying to merge two data files - they have different date formats and different times zones. I need to match up the date/time of the datasets and then invoke a conditional statement, such as: if dataC$mph is >= 12 then keep dataM$co23 for the corresponding time/date stamp. snippets of data files: *dataC.txt* LST in mph Deg DegF DegF2 % volts Deg
2008 Sep 29
1
describe function in package Hmisc and function format.dates in chron (PR#13087)
Full_Name: Kem Phillips Version: 2.7.1 (2008-06-23) OS: Windows Xp professional Submission from: (NULL) (98.221.200.108) The Hmisc function describe fails, giving the error message: Error in formatDateTime(dd, atx, !timeUsed) : could not find function "format.dates" Loading the chron package, where function dates apparently resides, does not fix the problem. Note
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
2006 Feb 02
1
Conflict between julian from base and from chron
I used to run the julian function from chron but this new version of R has also a julian function in the base package that doesn't do exactly what I need. Is there a way of telling R to run the function from chron and not from base? Thanks, Fernando __________________________ Fernando Colchero Doctoral Fellow Duke University Department of Ecology
2008 Aug 01
1
chron objects: input/output
Hi list, I have some questions regarding 1) conversion of date + time characters to chron 2) formatting chron object printing Regarding (1), Gabor's Rnews 2004 4/1 article has been indispensible, but I often work with files where dates and times are contained in a single field. In this case, I would like to control input/output of chron objects when each observation of date and time is
2000 Jul 20
4
RFC: System and time support functions in R
I've been looking over system utility functions that we might want to add to R. A few come out of specific needs, others from looking at other systems and what people are using system() for. I've taken account of Paul Gilbert's comments posted here a while ago (and I think covered all except the use of mailers). We currently have date *.socket file.create file.exists file.remove
2003 Dec 04
4
bug in as.POSIXct ?
I think that there is a bug in the as.POSIXct function on Windows. Here is what I get on Win2000, Pentium III machine in R 1.8.1. > dd1 <- ISOdatetime(2003, 10, 26, 0, 59, 59) > dd2 <- ISOdatetime(2003, 10, 26, 1, 0, 0) > dd2 - dd1 Time difference of 1.000278 hours Now, the 26th of October was the day that change to the standard time occurred, so I suspect that this has
2003 Dec 15
3
Julian Dates
Hi, I'm a bit confused how julian() works. If I understand right, it returns the number of days since the origin. I have a vector: > SLDATX[1:10] [1] "1986-01-06" "1986-01-17" "1986-02-02" "1986-02-04" [5] "1986-02-04" "1986-02-21" "1986-03-06" "1986-03-25" [9] "1986-04-06"
2008 May 14
1
Time differences (as.difftime?) issue
Dear all, I have a vector generated using the function strptime: > my.dt [1] "2004-04-19 08:35:00 W. Europe Daylight Time" "2004-04-19 09:35:00 W. Europe Daylight Time" "2004-04-19 11:35:00 W. Europe Daylight Time" [4] "2004-04-19 13:35:00 W. Europe Daylight Time" "2004-04-20 07:50:00 W. Europe Daylight Time" > class(my.dt) [1]
2003 Jul 31
4
timezones
I have some questions and comments on timezones. Problem 1. # get current time in current time zone > (now <- Sys.time()) [1] "2003-07-29 18:23:58 Eastern Daylight Time" # convert this to GMT > (now.gmt <- as.POSIXlt(now,tz="GMT")) [1] "2003-07-29 22:23:58 GMT" # take difference > now-now.gmt Time difference of -5 hours Note that the difference
2007 Apr 05
1
Extent of time zone vulerability for POSIX date and time classes
Hi. I frequently convert date and time data to and from character representations. I'm frustrated with chron, because 'seconds' are required to create a time object (my input data never has seconds). More importantly, I cannot make chron print the format 12/30/2006 (which my output data requires). I really like the format flexibility of strftime() and strptime(), but of course
2011 Feb 14
3
how to order POSIXt objects ?
I have a problem ordering by descending magnitude a POSIXt object. Can someone help please and let me know how to work around this. My goal is to be able to order my data by DATE and then by descending TIME. I have tried to include as much info as possible below. The problem stems from trying to read in times from a CSV file. I have converted the character time values to a POSIXt object using the
2001 Sep 07
1
chron is.weekend() function
Hello, I have a dataset which has fields giving both calendar date and weekday. I know better functions are now available, but I am still using chron because of the is.holiday() function and a homemade (even Heath Robinson would be ashamed) is.daylight() function. As a check for typos in the data input, I checked that the dates matched the weekdays. I'm getting some confusing results