Displaying 20 results from an estimated 666 matches for "chron".
2011 Aug 30
3
having trouble extracting week from chron object
Running R 2.13.1 on Windows XP.
I would like to get week of the year (1-52) for each date.
library(chron)
dts <- dates(c("02/27/92", "02/27/92", "01/14/92","02/28/92", "02/01/92"))
dts
dts.chron <- as.chron(dts)
dts.chron
class(dts.chron)
# all of these component extractions work:
months(dts.chron)
weekdays(dts.chron)
years(dts.chron)
quarters(dt...
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 tim...
2002 Oct 18
1
Chron problem with R 1.6.0 (PR#2181)
Full_Name: Rick Bilonick
Version: 1.6.0
OS: Linux (RH 7.1)
Submission from: (NULL) (12.4.226.1)
Hi. I'm using Red Hat 7.1 Linux (Intel 586). I installed the 1.6.0 rpm. No
problems were reported. When I tried to load the chron library:
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "/usr/lib/R/library/chron/libs/chron.so":
libR.so: cannot load shared object file: No such file or directory
Error in library(chron) : .First.lib failed
I checked to see if there...
2013 May 01
3
Chron format question h:m not working
R 2.12.2 on Scientific Linux 6.4
#works
chron(times.="15:00:00", format=c(times="h:m:s"))
#doesn't work
chron(times.="15:00", format=c(times="h:m"))
From chron Manual:
The times format can be any permutation of "h", "m", and "s" separated
by any one non-special chara...
2003 Nov 11
4
HMisc describe -- error with dates
...ata frame. I have specified certain
variables as dates using, for example:
df1$aidsdate <- dates(aidsdate,format="day.mon.year", origin=c(month = 1,
day = 1, year = 1960))
When I use describe on the dataframe I get this error:
Error in Ops.dates(weights, x) : * not defined for chron objects
Has anyone had this problem? I had used the same method with an older version of
R and HMisc and it worked.
Should be be formatting date variables differently?
Thank you!
Sincerely,
Tanya Murphy
-------------------------------------------------
This mail sent through IMP: http://hord...
2012 Nov 27
2
Some questions about chron package..
Hello,
I have questions while reviewing "chron" package(e.g.,chron.R).
1. What is the differences between 3 kinds of function definition ?
1) "name" <- function(...
2) 'name' <- function(...
3) name <- function(...
Do you know Why author used various kinds of definitions ?
Is there no functio...
2012 Jun 15
2
time zones and the chron to POSIXct conversion
Hey R folks,
i found some strange (to me) behaviour with chron to POSIXct conversion.
The two lines of code result in two different results, on ewith the
correct time zone, one without:
library(chron)
as.POSIXct(chron('12/12/2000'), tz = 'UTC')
as.POSIXlt(chron('12/12/2000'), tz = 'UTC')
Only the code below would give me a P...
2005 May 17
2
cumsum on chron objects
Hi,
Is there some alternative to cumsum for chron objects? I have data frames
that contain some chron objects that look like this:
DateTime
13/10/03 12:30:35
NA
NA
NA
15/10/03 16:30:05
NA
NA
...
and I've been trying to replace the NA's so that a date/time sequence is
created starting with the preceding available value. Because the numbe...
2006 Jun 23
2
problem with hist() for 'times' objects from 'chron' package
Hello dear useRs and wizaRds,
I encountered the following problem using the hist() method for the
'times' classes
from package 'chron'. You should be able to recreate it using the code:
library(chron)
# pasted from chron help file (?chron)
dts <- dates(c("02/27/92", "02/27/92", "01/14/92", "02/28/92",
"02/01/92"))
class(dts)
hist(dts) # which yields:
# Error in axis(s...
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 ques...
2005 Jun 01
2
problem with chron scales in lattice
...to work as I
expected. I'm using R-2.1.0 and lattice 0.11-8. There should be year
labels from 1992 to 2004 for the x axis in the plot below, but instead
only a few of them appear, and in the wrong spots, as if the coordinate
system has changed after finishing with the panel function.
library(chron)
library(lattice)
# vertical grid lines at start of each year
startdate <- "1/1/1992"
enddate <- "1/1/2005"
startdatetime <- chron(dates=startdate, times="00:00:00")
enddatetime <- chron(dates=enddate, times="00:00:00")
x.lines <- as.chron(s...
2011 Jul 28
3
how to shift a chron timestamp by 6:30 hours
Dear help list,
I have a timestamp in as a chron object:
> (x <- chron(dates = c("12/02/11", "22/11/11"),
+ times = c("07:30:00", "04:00:00"),
+ format = c(dates = "d/m/y", times = "h:m:s")))
[1] (12/02/11 07:30:00) (22/11/11 04:00:00)
Now I want to shift...
2005 Nov 16
1
COM dates (was origin and "origin<-" in chron)
I was just looking for an easy way to convert between COM datetime and
chron datetime (both ways.)
I found examples on the list, but they involved origin.
Does anyone have functions for converting COM datetime <-> chron
datetimethat work "safely"?
David L. Reiner
> -----Original Message-----
> From: Gabor Grothendieck [mailto:ggrothend...
2004 May 26
1
FW: is.weekend() odd behaviour
Kurt,
Uwe suggested I write to you as maintainer of chron ... at the start of
is.weekend, in the check on the argument type, maybe just change chron() to
as.chron()? This would ensure as.chron.POSIXt gets called on POSIXt
arguments, and (I think) fixes the problem. I tested and it seems ok. No
warning/error required.
> is.weekend
function(x)
{
if(...
2005 Jul 13
2
convert to chron objects
Hi,
I have a column of a dataframe which has time stamps
like:
> eh$t[1]
[1] 06/05/2005 01:15:25
and was wondering how to convert it to chron variable.
Thanks a lot.
Young.
2006 Jul 14
2
chron vs. POSIX
...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 POSIX".
This seems to me a very efficient strategy, judging from my own
experiences and those of others users. All but the simplest calculations
with POSIX objects demand great care, due to time zone and and daylight
savings considerations. Therefore, I've always chos...
2008 Jul 31
2
S 3 generic method consistency warning please help
I would like to include this in a package. The S3 methods on R CMD check
says
* checking S3 generic/method consistency ... WARNING
window:
function(x, ...)
window.chron:
function(data, day1, hour1, day2, hour2, ...)
See section 'Generic functions and methods' of the 'Writing R Extensions'
manual.
I have looked and can not figure it out. This function is for convience.
What can I do to fix this? This is the first time I have tried this, so be...
2006 Nov 20
1
a little help needed plotting chron object
...st program is
to plot the time of day of file creation on an x axis that spans a
user-specified range (like 12:00:00 to 15:00:00).
If I allow autoscaling I get nice time values on the plot. If I try to set
an x range, instead I get numbers between 0 and 1 on the x axis.
Test Program:
library(chron)
f=list.files() # GET THE LIST OF FILES IN THE CURRENT DIRECTORY
f2=file.info(f) # FOR THE FILES, GET ALL THE INFO
c5=f2[,5] # COLUMN 5 IS THE DATE & TIME STAMP
print(c5) # LETS SEE IT
of2=order(c5) # GENERATE ORDERING VECTOR
c5o=c5[of2] # PUT FILE NAMES IN ORDER, IN A NEW...
2011 Sep 16
1
Mystified - comparing chron times
I have two local variables: startTime and expectedStartTime. Both are chron
related objects.
When I look at the class for the objects I can see they are of class
"times".
When I print them to the console, they both read: "09:30:00"
When I print them as.numeric(), they both read: 0.3958333
When I try and compare them: (as.numeric(startTime) ==
as.numeric...
2006 Sep 20
1
hours() in 'chron': output != input
I encountered surprising (to me, at least) behavior while using 'hours()'
in package 'chron.' I will be grateful if someone can point out my error
or provide an explanation and intuitive solution (I suppose I could
convert chron to a character vector and use substring, but I deal mostly
with newbies and kludgy approaches don't inspire much confidence).
I used 2.3.0 to construc...