Displaying 20 results from an estimated 4000 matches similar to: "I() fails on objects of class POSIXct (PR#1587)"
2005 Dec 19
3
given a mid-month date, get the month-end date
I have a vector of dates.
I wish to find the month end date for each.
Any suggestions?
e.g.
For 12/15/05, I want 12/31/05,
For 10/15/1995, I want 10/31/1995, etc
__________________________________________________
[[alternative HTML version deleted]]
2008 Apr 10
1
ISOdate/ISOdatetime performance suggestions, other date/time questions
Dear list:
working with date/times I have come across a problem that ISOdate and
ISOdatetime are too slow on large vectors of data. I was surprised just
until I looked at the implementation and the man page: "ISOdatetime and
ISOdate are convenience wrappers for strptime". In other terms, they
convert data to character representation first in order to create a
POSIXlt object that is then
2005 Oct 06
2
isdst
Can someone, please, explain the difference is results below (notice
the isdst value)
> unlist(as.POSIXlt('2005-7-1'))
sec min hour mday mon year wday yday isdst
0 0 0 1 6 105 5 181 1
> unlist(as.POSIXlt(as.Date('2005-7-1')))
sec min hour mday mon year wday yday isdst
0 0 0 1 6 105 5 181 0
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,
2020 Oct 23
2
The presence/absence of `zone` in POSIXlt depending on time zone as a cause of possible inconsistences?
Dear all,
I have just detected what seems a minor inconsistence with data types. If one unlists a POSIXlt time with GMT zone gets a numeric vector, since the POSIXlt list has no `zone` element, while if one unlists a POSIXlt time with a non GMT zone (also non specifying tz if the Sys.timezone is not GMT) gets a character vector due to including the `zone` element.
> x <-
2010 Oct 01
3
Converting a dataframe column from string to datetime
Hi,
I have a dataframe column of the form
v<-c("Fri Feb 05 20:00:01.43000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:06.34000 2010")
I need to convert this to datetime form. I did the following..
lapply(v,function(x){strptime(x, "%a %b %d %H:%M:%OS %Y")})
This gives me a list that looks like
2020 Oct 01
3
timezone tests and R-devel
The return value of Sys.time() today with a timezone of US/Eastern is
unchanged between 4.0.3-patched and devel, but on devel the following test
fails
all.equal(x, as.POSIXlt(x))
with
x = Sys.time()
This means that devel does not complete make tests (failure on
tests/reg-tests-2.R)
It is entirely possible that it is an error on my end, I use
export TZ="US/Eastern"
but I have been
2003 Aug 13
1
Problems with addition in big POSIX dates
Have you noticed any problems with big dates (>=1/1/2040) in R?
Here is the bit of code that I'm having trouble with:
> test.date <- strptime("1/1/2040",format="%m/%d/%Y")
>
> unlist(test.date)
sec min hour mday mon year wday yday isdst
0 0 0 1 0 140 0 0 0
>
> date.plus.one <- as.POSIXct(test.date) +
2010 Dec 27
1
Can't merge on datetime?
x = structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), min = c(0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L), hour = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), mday = c(1L, 2L,
3L, 4L, 5L, 8L, 9L, 10L, 11L, 12L, 15L, 16L, 17L, 18L, 19L, 22L,
23L, 24L,
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
2017 May 17
2
R-3.4.0 fails test
After installing R-3.4.0 I ran 'make check' which halted here:
$ > tail reg-tests-1d.Rout.fail -n 16
> ## format()ing invalid hand-constructed POSIXlt objects
> d <- as.POSIXlt("2016-12-06"); d$zone <- 1
> tools::assertError(format(d))
> d$zone <- NULL
> stopifnot(identical(format(d),"2016-12-06"))
> d$zone <- "CET" # =
2017 May 17
2
R-3.4.0 fails test
After installing R-3.4.0 I ran 'make check' which halted here:
$ > tail reg-tests-1d.Rout.fail -n 16
> ## format()ing invalid hand-constructed POSIXlt objects
> d <- as.POSIXlt("2016-12-06"); d$zone <- 1
> tools::assertError(format(d))
> d$zone <- NULL
> stopifnot(identical(format(d),"2016-12-06"))
> d$zone <- "CET" # =
2009 Mar 04
2
patch for axis.POSIXct (related to timezones)
I am finding that axis.POSIXct uses the local timezone for deciding where to
put tic marks, even if the data being plotted are in another time zone. The
solution is to use attr() to copy from the 'x' (provided as an argument) to
the 'z' (used for the 'at' locations).
I have pasted my proposed solution in section 1 below (as a diff). Then, in
section 2, I'll put some
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')
2020 Oct 02
2
timezone tests and R-devel
Yes, the potential issue I see is that
make check
fails when I explicitly set TZ. However, I set it to be the same as what
the system reports when I login.
Details: The system (RHEL) I am working on has
$ strings /etc/localtime | tail -n 1
EST5EDT,M3.2.0,M11.1.0
$ date +%Z
EDT
$ echo $TZ
US/Eastern
On Fri, Oct 2, 2020 at 9:48 AM Sebastian Meyer <seb.meyer at fau.de> wrote:
> Thank
2013 Feb 08
2
Can not melt data.frame
I realize it's -12C and we're having the next best thing to a blizzard but why can I not melt this data frame.
I am missing something terribly obvious but I just don't understand what the error message is saying.
John Kane
Kingston ON Canada
Code and aata below
#================================================#
library(reshape2)
melt(mydata, id.vars = c("date"))
2009 Jan 15
4
number of Mondays
dear All,
i'm trying to calculate the number of Mondays, Tuesdays, etc that each
month within a date range has. I have time series data that spans 60
months and i want to calculate the number of Mondays, Tuesdays, Wed,
etc of each month. (I want to control for weekly seasonality but my
data is monthly).
Is there an easy way to to this in R? or is there a package i could
use? i did
2011 Jun 22
2
strange date problem - May 3, 1992 is NA
> is.na(strptime("5/2/1992", format="%m/%d/%Y"))
[1] FALSE
> is.na(strptime("5/3/1992", format="%m/%d/%Y"))
[1] TRUE
Any idea what's going on with this? Running strptime against all dates
from around 1946, only 5/3/1992 was converted as "NA". Even stranger,
it still seems to have a value associated with it (even though is.na
thinks
2011 Feb 19
1
problem in plotting numeric x by POSIXt class with lattice
# hi all,
# I'm trying to plot temperatures by date in a trellis plot by their
stations
# I'm plotting the following data.frame
library(lattice)
h <- structure(list(station_name = structure(c(3L, 4L, 2L, 10L, 11L,
12L, 6L, 7L, 5L, 8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L, 5L,
8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L), .Label = c("Ashqelon",
"Beer Sheva",
2010 Sep 03
1
Incorrect formatted output after subtracting non-integer seconds from POSIXt origin
> x<-as.POSIXct("1970-1-1", tz="UTC")-.5
> y<-as.POSIXct("1970-1-1", tz="UTC")+.5
> x==y
[1] FALSE # of course
but x and y "appear" to be the same when formatted, even with extra
precision:
> format(x, format="%Y-%m-%d %H:%M:%OS2")
[1] "1970-01-01 00:00:00.50"
> format(y, format="%Y-%m-%d