Displaying 20 results from an estimated 4000 matches similar to: "forwarded: bug (?) in cut.POSIXt with "breaks"=integer"
2010 Apr 29
1
bug in cut.POSIXt(..., breaks = <numeric>) and cut.Date
x <- seq(as.POSIXct("2000-01-01"), by = "days", length = 20)
cut(x, breaks = 3)
# Error in `levels<-.factor`(`*tmp*`, value = character(0)) :
# number of levels differs
cut(as.Date(x), breaks = 3)
# Error in `levels<-.factor`(`*tmp*`, value = character(0)) :
# number of levels differs
Index: base/R/datetime.R
2010 Feb 01
1
Error with cut.POSIXt and daylight savings time switchover dates
The following code:
cut(as.POSIXct("2009-11-01 04:00:00", tz="America/Los_Angeles"), "1 day")
gives the error:
Error in seq.int(0, to - from, by) : 'to' must be finite
This is related to November 1st, 2009 being the switchover date from daylight savings time to standard time in the America/Los_Angeles time zone. In particular, in cut.POSIXt, the starting
2010 Mar 10
4
cut.POSIXt misconception/feature/bug?
Dear all
recently I tried to split vector of dates according to some particular
date to 2 (more) chunks, but I was not able to perform correct setting.
When I want split to 3 chunks it partially works however from help page I
supposed to get result without NA.
Details:
Using both ?right = TRUE? and ?include.lowest = TRUE? will
include both ends of the range of dates.
dat <-
2008 Mar 18
4
cut.Date and cut.POSIXt problem
cut.Date and cut.POSIXt indicate that the breaks argument
can be an integer followed by a space followed by "year", etc.
but it seems the integer is ignored.
For example, I assume that breaks = "3 months" is supposed
to cut it into quarters but, in fact, it cuts it into months as if
3 had not been there.
> d <- seq(Sys.Date(), length = 12, by = "month")
>
2017 Apr 06
1
[bug] in cut.POSIXt(..., breaks = <numeric>)
The exact error was reported before in *Bug 14288*
<https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14288> *- **bug in
cut.POSIXt(..., breaks = <numeric>) and cut.Date. *But the fix in that bug
report only covered the simplest case.
This is the error I met
-----------------------------
x <- structure(c(1057067700, 1057215720, 1060597800, 1061470800,
1061911680,
1062048000,
2005 Feb 10
3
question about sorting POSIXt vector
Dear useRs,
How come the first attempt to sort a POSIXt vector fails (Error:
non-atomic type in greater), while the second succeeds? (Code inserted
below.) The documentation says that POSIXt is used to allow operations
such as subtraction, so I'd expect sorting to work. Is this perhaps an
OS issue? (I run R 2.0.1 on Win xp.)
Thank you,
b.
#------------code
test <- c("2005-02-08
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
2009 Nov 16
0
(Date + difftime) and (POSIXt + difftime) does not use date/time arithmetics (PR#14067)
Full_Name: Suharto Anggono
Version: 2.8.1
OS: Windows
Submission from: (NULL) (125.165.81.48)
There is already PR#13369. But, the problem is not just the warning.
C:\Program Files\R\R-2.8.1\bin>R --vanilla
R version 2.8.1 (2008-12-22)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome
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
2009 Sep 09
1
Monkey patching +.POSIXt
Hi all,
This summer I've been working with a grad student to bring more of the
date time classes from JODA (http://joda-time.sourceforge.net/) into
R. To make these work seamlessly with existing date time objects, we
need to patch +.POSIXt. (The ruby community uses the term
monkey-patching for this sort of ill-advised, by sometimes necessary,
internal hackery, hence the title.) The problem is
2007 Jan 04
3
problem with plot() and POSIXt dates
Hy all,
I'm plotting graphs using plot() function, they are on X axes POSIX dates:
"POSIXt" "oldClass" "POSIXct" "POSIXlt"
I can't figure out why sometimes it prints the month and days and sometimes it prints the unix timestamp.
It appens usually when the xlim is short like only some days.
xlim is settled as a POSIXt like this
"2006-12-30
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
2006 Dec 07
2
Matplot does not work with x being POSIXt class (PR#9412)
Hi,
Matplot works with x being Date class but not POSIXt. Here is the
example with R version 2.5.0 Under development (unstable) (2006-12-06
r40129)
Example:
x <- Sys.Date() - c(1:10)
y <- cbind(1:10, 10:1)
class(x)
## [1] "Date"
matplot(x, y)
x <- strptime(as.character(x), format="%Y-%m-%d")
## [1] "POSIXt" "POSIXlt"
matplot(x, y)
Error in
2012 Feb 24
6
strange behaviour of "POSIXlt" "POSIXt" object
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"
Browse[2]> is.na(hcEnd)
[1] TRUE
This issue is the source of my all issues in my program,
Thanks for your help
--
View this message in context:
2007 Dec 11
3
Wrong length of POSIXt vectors (PR#10507)
Full_Name: Petr Simecek
Version: 2.5.1, 2.6.1
OS: Windows XP
Submission from: (NULL) (195.113.231.2)
Several times I have experienced that a length of a POSIXt vector has not been
computed right.
Example:
tv<-structure(list(sec = c(50, 0, 55, 12, 2, 0, 37, NA, 17, 3, 31
), min = c(1L, 10L, 11L, 15L, 16L, 18L, 18L, NA, 20L, 22L, 22L
), hour = c(12L, 12L, 12L, 12L, 12L, 12L, 12L, NA, 12L,
2002 Mar 26
1
seq.POSIXt() with short time intervals
I was surprised when seq.POSIXt() returned a single value rather than
a vector, from inputs that I thought were reasonable. Here's an
example to illustrate:
> t0 <- ISOdatetime(2002,6,24,0,0,10)
## expected a sequence of 16 times 1 second apart
> seq.POSIXt(from=t0,to=t0+15,by='1 sec')
[1] "2002-06-24 00:00:10 PDT"
## traces to this call
>
2007 Aug 08
2
Error: Cannot Coerce POSIXt to POSIXct when building package
A newbie here - please forgive me if this is a basic question. We have an
in house package built in R 2.2.1 (yes we're a little behind the times at
our firm)and would like to rebuild it using R 2.5.1. However, when I try
and build the package from source, I keep getting this error:
Error in as(slotVal, slotClass, strict = FALSE) :
no method or default for coercing "POSIXt"
2012 Nov 05
1
Dates as POSIXt
When I try to do linear interpolation between financial contracts with maturities on different dates in different months I have come across some behavior I haven't seen before.
I have a data frame in R which is loaded from an access database so I can't provide a working example. It was loaded using this code:
> dbPath <- "H:/pathToDB/DB.mdb"
> channel <-
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"
2005 Apr 14
1
xtable POSIXt
Hi,
I was trying like to print out data frame with POSIXct column
in html format using xtable package, but I got error message
when trying to print the table. Here is example:
aaa<-data.frame(as.POSIXct(strptime('03 2005', '%d %Y')),0)
aaa.tab<-xtable(aaa)
print(aaa.tab)
Error in Math.POSIXt(x + ifelse(x == 0, 1, 0)) :
abs not defined for POSIXt objects