Displaying 20 results from an estimated 4000 matches similar to: "timeAlign"
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 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
2002 May 21
1
I() fails on objects of class POSIXct (PR#1587)
Although the documentation is somewhat sketchy, I() can be used to create
objects of class AsIs:
> I("a")
[1] "a"
attr(,"class")
[1] "AsIs" "character"
> I(4)
[1] 4
attr(,"class")
[1] "AsIs" "numeric"
> I(4 + 0i)
[1] 4+0i
attr(,"class")
[1] "AsIs" "complex"
>
This
2005 Feb 15
2
how many 7th of the month is there between two dates
This is a eaeir way to ask my prior question:
I want to caculate how many an exact day of the month there is between
two dates.
For example; How many 7th of the month is there between "1998/12/17"
and "2000/1/7". To make the problem simple, the day of the month (7)
is the day in the 2nd date.
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
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
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]]
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
2011 May 14
2
changing the day of the week in dates format
Dear all,
I have a question related to the POSIXlt function in R.
I have a set of dates and times, for exmaple:
startx <- as.POSIXct("2011-01-01 00:00:00")
finx <- as.POSIXct("2011-12-31 00:00:00")
daysx<- seq(startx, finx, by="24 hours")
I
want to change the dates of all the days falling on a Saturday to the
next working day (i.e. Monday). So I
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
2005 Oct 27
3
its dates masked by chron
I built R 2.2.0 from source on my debian machine yesterday and updated
all packages. My problem is that "dates" function from its, that my
code heavely uses is now masked by "dates" from chron.
How can I specify tehat I want to use dates from its or how can I
prevent it from being masked?
> library(its)
Loading required package: Hmisc
Hmisc library by Frank E Harrell Jr
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 <-
2002 Oct 17
4
Posix Problem, difftime
I am having a series of problems using date time data that has been converted into a POSIXt and POSIXlt classes. I have hourly time series data from 1900 that has been converted from text data.
I assume most of my problems come from a mis-underdanding of the POSIX class. My matrix named (aa) for this year is approx 8700 by 4. When I try to calculate the length of posit column ( which is the
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) +
2008 Sep 17
4
cron job not working
Here's a perl script that works when I run it manually. But when I
run it via cron, it won't create the directory. But worse than that,
an email isn't sent to the account running the job. So I'm not
getting an error, but it does work when I run it manually.
If I put an obvious error in the script, cron does generate an
email giving me the STDERR.
What could it be?
=== Al
2005 May 13
2
without the loop
Can this be re-implemented to run faster (without the loop) ?
r <- list()
n = nrow(prices)
for (i in (w+1):n) {
window <- prices[(i-w):(i-1),]
if (prices[i,]$settle > max(window$high)) r <-
append(r, 1)
else if (prices[i,]$settle < min(window$low)) r <-
append(r, -1)
2005 Jun 24
2
seq in R
I want to generate a sequence from 1 to x by 1
seq(1,x,by=1)
I want the above to return an empty list if x is zero
In other languages I can do 1:x:1 to force the increment by to be a
positive 1. This syntax does not work in R. In R 1:x gives me
1 0
when x is zero, this is not what I want.
The seq statement above throws an error when x is 0.
How can I generate a sequence where if the
2006 May 26
2
Too many open files
This may be more of an OS question ...
I have this call
r = get.hist.quote(symbol, start= format(start, "%Y-%m-%d"), end=
format(end, "%Y-%m-%d"))
which does a url request
in a loop and my program runs out of file handlers after few hundred
rotations. The error message is: 'Too many open files'. Other than
increasing the file handlers assigned to my process, is there
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,