Displaying 20 results from an estimated 10000 matches similar to: "Problems with as.POSIXct"
2006 Nov 27
2
as.Date: conversion pb from POSIXct (PR#9386)
Full_Name: Xiao Gang FAN
Version: 2.4.0
OS: Windows
Submission from: (NULL) (159.50.101.9)
> library(chron)
> as.Date(as.POSIXct(strptime("1994-01-24","%Y-%m-%d")))
[1] "1994-01-23"
2003 Jan 03
4
as.POSIXct problem?
Under
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 6.1
year 2002
month 11
day 01
language R
> x <- strptime(c('10/10/1969','12/31/2002'),format='%m/%d/%Y')
2013 Aug 25
3
POSIXct bug for conversion of specific combinations of date and time
Hello everyone,
I'm having a big trouble with which seems to be a bug in as.POSIXct()
date-time conversion. I have massive GPS datasets in which each location
has it's own date and time attribute. As I convert them to POSIXct format,
1300 cases (of about half a million locations) simply return NA values.
I picked up a small sample of failed cases and normal cases to demonstrate
the
2007 Jan 17
2
problem with unlist POSIX date at midnight
Dear R-users,
I use unlist of POSIX dates to extract the year, hour etc. With that I
can search for files in my database which are in the form
'yyyymmddhh_synops.txt'
However, I get stucked during midnight where unlist just gives NA's.
The script is given below, the problem accurs at acc.period[16]
(midnight). However when I write out the character, unlist works well.
But
2009 Oct 05
6
Date-Time-Stamp input method for user-specific formats
Date-Time-Stamp input method to correctly interpret user-specific
formats:coding is 90% there - based on exmple at
http://tolstoy.newcastle.edu.au/R/help/05/02/12003.html
...anyone got the last 10% please?
CONTEXT:
Data is received where one of the columns is a datetimestamp. At midnight,
the value represented as text in this column consists of just the date part,
e.g.
2001 Nov 26
3
Doing things with POSIXt
Dear R-Users,
I have a data file with timestamps and I wanted to use POSIXct time data
type to represent the respective column. I played around with the type and
found a couple of issues:
* there seems to be no direct way of reading datetimes into a variable.
Let's say this is my file
"1992-02-27 23:03:20 PST"
"1992-02-27 22:29:56 PST"
"1992-01-14 01:03:30 PST"
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
2013 Jan 11
1
Date time conversion bug (as.POSIXct)?
There is something wrong, I think, with the date-time conversion from a
numeric value if you use Central European Time (CET) as timezone.
Examples from R:
If I use the GMT time zone it is OK, I get the same time back from
as.POSIXct as I entered
> as.POSIXct(as.numeric(strptime("30/01/2012 13:00:00", format="%d/%m/%Y
>
2004 Oct 28
2
POSIX time anomaly (PR#7317)
Full_Name: Allen McIntosh
Version: 2.0.0
OS: RedHat 9.0
Submission from: (NULL) (67.80.175.118)
The POSIX time printing routine gives strange results when asked to print a time
that is exactly midnight:
TZ=CST6CDT R -q --no-save
> strptime("10/5/2004 00:00:01 CDT", "%m/%d/%Y %H:%M:%S %Z")
[1] "2004-10-05 00:00:01"
> strptime("10/5/2004 00:00:00
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
2003 Sep 02
1
convert character to POSIXct
Dear list-members,
I would like to calculate the difference between two points in time. To convert a 'time (GMT)'-character with the format "1/1/1999 01:01:01" into an object of class "POSIXct"', I first use the strptime() as suggested in the details help(as.POSIXct).
e.g.
starttime<-strptime("1/1/1999 01:01:01",format="%d/%m/%Y %H:%M:%S")
2005 Apr 22
2
help with POSIX
For the r script below
>datestr <- "01/01/2004"
>as.POSIXct(as.Date(datestr, "%d/%m/%Y"))
I get the following output
"2003-12-31 18:00:00 Central Standard Time"
Why is the date a day before. I guess its something to do with the time, but is there a way to get it to return 2004-01-01 instead?
Thanks in advance...
-Sandeep
[[alternative HTML version
2012 Oct 30
2
POSIXct date missing "time component"
Hi,
I have some dates that are giving me a problem, in general the dates look
like this:
free.dates[60:61]
[1] "2009-05-21 23:45:00 GMT" "2009-05-22 00:00:00 GMT"
but for some reason, when taken "alone", they look like this:
free.dates[60]
[1] "2009-05-21 23:45:00 GMT"
free.dates[61]
[1] "2009-05-22 GMT" # the time component is gone, and
2009 Oct 26
3
as.POSIXct month problem
Hi everybody
When I try example of strptime
x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
z <- strptime(x, "%d%b%Y")
The result is;
> z
[1] NA NA NA NA
I have got the same result with complete form of month but not with numeric
form.
Any idea?
[[alternative HTML version deleted]]
2013 Apr 26
3
converting character matrix to POSIXct matrix
I thought this is a common question but rseek/google searches don't yield
any relevant hit.
I have a matrix of character strings, which are time stamps,
> time.m[1:5,1:5]
[,1] [,2] [,3] [,4] [,5]
[1,] "08:00:20.799" "08:00:20.799" "08:00:20.799" "08:00:20.799"
"08:00:20.799"
[2,]
2016 Apr 11
2
Query about use of format in strptime
Dear Jim and dear Enrico,
thank you for your replies.
Unfortunately your hints didn't solve my problem, and I am getting mad.
Can I show you my whole process? I will be as quick as possible.
I start from a data frame called Snow of the form
year month day hh mm hs
2007 11 19 0 0 0.00
2007 11 19 0 30 0.00
2007 11 19 1 0 0.00
2007 11 19 1 30 0.00
2007 11 19 2 0 0.00
2007 11 19 2 30 0.00
2007 11
2004 May 27
2
axis.POSIXct: Datetime data and plotting
I've run into a problem with the datetime axis generated by axis.POSIXct. It appears a similar issue was discussed in October 2003 under the subject line "datetime data and plotting" (see https://stat.ethz.ch/pipermail/r-help/2003-October/039071.html), but I wasn't able to determine whether there is a straightforward solution.
The code below produces a graph with apparently
2006 Jul 23
1
diff, POSIXct, POSIXlt, POSIXt
Dear Listers,
I have encountered a strange problem using diff() and POSIXt:
dts<-c("15/4/2003","15/7/2003","15/10/2003","15/04/2004","15/07/2004","15/10/2004","15/4/2005","15/07/2005","15/10/2005","15/4/2006")
dts <- strptime(dts, "%d/%m/%Y")
class(dts)
[1] "POSIXt"
2006 Jul 23
1
diff, POSIXct, POSIXlt, POSIXt
Dear Listers,
I have encountered a strange problem using diff() and POSIXt:
dts<-c("15/4/2003","15/7/2003","15/10/2003","15/04/2004","15/07/2004","15/10/2004","15/4/2005","15/07/2005","15/10/2005","15/4/2006")
dts <- strptime(dts, "%d/%m/%Y")
class(dts)
[1] "POSIXt"
2003 Mar 05
1
printing POSIXct values in table labels
Hi,
I think that there is something that I am misunderstanding in creating tables
using dates that are of class POSIXct. Consider:
> x <- data.frame(date = as.POSIXct(strptime(c(rep("2002-10-17", 4), rep("1999-12-08", 2)), format = "%Y-%m-%d")))
> x
date
1 2002-10-17
2 2002-10-17
3 2002-10-17
4 2002-10-17
5 1999-12-08
6 1999-12-08
> table(x$date)