Displaying 20 results from an estimated 2000 matches similar to: "Need help on parsing dates"
2004 May 27
3
Date parsing question
How do I parse a date "yyyymmdd"? I tried asking chron(s, "ymd") but
that didn't work. Would the date parsing routines of the Date class of
1.9 grok this?
--
Ajay Shah Consultant
ajayshah at mayin.org Department of Economic Affairs
http://www.mayin.org/ajayshah Ministry of Finance, New Delhi
2007 Mar 12
1
timeDate & business day
I have a daily time series and have two questions to get some help with.
Firs,t I have dates in simple numeric values. e.g.
ymd
[1] 20050104 20050105 20050106 20050107 20050110 20050111 20050113 20050114
[9] 20050118 20050120 20050121 20050124 20050125 20050126 20050127 20050128
[17] 20050201 20050202 20050203 20050204
Now, I'd like to compute statistics, e.g. acf, by business days. So, I
2008 Jan 15
7
PHP indexing, what's the PHP method for indexscript
Currently I have the following indexscript:
pid : unique=Q boolean=Q field=pid
postdate : field=startdate
author_name: unhtml boolean=XAUTHORNAME field=author
author_id: boolean=XAUTHORID field=authorid
url : field=url
sample : weight=1 index field=sample
How can I create the same indexing using PHP?
With this, I can get an searchable index, but I have no idea how to set the fields, so that I
2008 Sep 11
3
Truncating dates (and other date-time manipulations)
Dear all,
I've been struggling to perform common operations on dates that I need
to be able to correct draw date-time scales - in particular I need to
be able to round/truncate/ceiling dates to arbitrary precision - e.g.
to weeks, months or years (or multiples thereof). I haven't been able
to find anything to do this in base R (trunc.Date only truncates to
sub-day units), or in the date
2004 Jun 14
4
Quirks with system.time and simulations
I tried the code that Richard O'Keefe posted last week, to wit:
library(chron)
ymd.to.POSIXlt <-
function (y, m, d) as.POSIXlt(chron(julian(y=y, x=m, d=d)))
n <- 100000
y <- sample(1970:2004, n, replace=TRUE)
m <- sample(1:12, n, replace=TRUE)
d <- sample(1:28, n, replace=TRUE)
system.time(ymd.to.POSIXlt(y, m, d))
[1] 8.78 0.10
2006 Jun 15
1
Problem with Julian function
Dear all,
I have a problem with the function Julian, may be a bug in the function ?
Here is a vector of character, which represents dates (May 18 to May 20
2000):
> amj <- c("2000-05-18","2000-05-18","2000-05-18","2000-05-19","2000-05-19"
> ,"2000-05-19", "2000-05-19", "2000-05-20", "2000-05-20",
2006 Nov 16
6
Gantt chart problem after upgrade to R 2.4.0
I am having a problem with a gantt chart since
moving to R2.4.0. from 2.3.1
I made some adaptations to the code from
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=74
and successful produced a simple gantt chart. However
when I upgraded to 2.4.0 it no longer works as
desired. See
http://ca.geocities.com/jrkrideau/R/gantproblem.pdf
for the two charts. The charts were produced
2009 Aug 21
2
gantt chart for dataset
hi,
Thanks for responding of gantt charts. but i have some problem regarding
with gantt charts. i.e.
Ymd.format <- "%Y/%m/%d"
Ymd <- function(x){ as.POSIXct(strptime(x, format=Ymd.format))}
gantt.info <- list(
labels =c("First task","Second task","Third task","Fourth task","Fifth
task"),
starts
2007 Mar 28
18
Version numbering
After v1.0 is released, I can finally get back to sane version numbers.
But any comments on which one is better:
a) Postfix-style: "1.1.UNSTABLE.YYYYMMDD" -> 1.1.0 (stable)
b) Odd-even numbering: 1.1.x (unstable) -> 1.2.0 (stable)
With a) style the releases could be done by simply copying a nightly
snapshot to releases/ directory and announcing the changes since the
last
2011 Dec 02
2
Problem subsetting: undefined columns
Dear R-users,
-I am new to R, and I am struggling with the following problem.
-I am repeating the following operations hundreds of times, within a loop:
I want to subset a data frame by columns. I am interested in the columns
names that are given by the rows of another data frame that was built in
parallel. The solution I have so far works well as long as the elements of
the second data frame
2024 Nov 09
3
Limit
Hi All,
I am reading data file ( > 1B rows) and do some date formatting like
dat=fread(mydatafile)
dat$date1 <- as.Date(ymd(dat$date1))
However, I am getting an error message saying that
Error: cons memory exhausted (limit reached?)
The script was working when the number rows were around 650M.
Is there another way to handle a big data set in R?
Thank you.
2014 Jul 17
3
FW: Selección eficiente de individuos
Hola,
Otra forma, utilizando la función de intervalos y la que comprueba si otro
intervalo se solapa del paquete "lubridate":
#----------------------
library(lubridate)
fe.chas <- data.frame(
entra=c('2001-01-01','2001-06-01','2003-01-01')
,sale=c('2002-01-01','2002-06-01','2004-01-01')
)
ref <-
2010 Feb 27
1
help with Gantt chart
Hi,
I don't know to solve this error that is returned, even though I understand it:
library(plotrix)
Ymd.format<-"%Y/%m/%d"
gantt.info<-list(labels=
c("First task","Second task (1st part)","Third task (1st part)","Second task (2nd part)","Third task (2nd part)",
"Fourt task","Fifth task","Sixth
2009 Jul 21
4
how to transform m/d/yyyy to yyyymmdd?
Hello,
I have a set of data that has a Date column looks like this:
12/9/2007
12/16/2007
1/1/2008
1/3/2008
1/12/2008
etc.
I'd like the date to look something like the follow (so that I could sort by
date easily).
20071209
20071216
20080101
20080103
20080112
How to do it? Thank you very much
Julia
--
View this message in context:
2012 Jun 08
3
day of the year for chron objects
Hi!
Is not there an standard R function to retrieve the day of the year
(since 1st Jan of the same year)?
I know I can make my own using julian, but find it weird that having
days(), months() etc doy() does not exist as an standard function.
Also, is the following not a bit inconsistent?
> a <- chron("20100506",format="ymd")
> a
[1] 100506
> years(a)
[1] 2010
2017 Feb 16
6
Ayuda con Date
Hola.
Tengo una duda con esta sintaxis. Tengo una variable con formato Date que
por algún motivo (el data.table viene de una consulta con PostgreSQL):
datos <- prov[, pprid, pprfecbaja]
str(datos)
Cuando intento quitar las fechas de bajas inválidas (0001-01-01) y
convertirlas a NA, la variable resultante "pierde" su condición de Date.
Probé con distintas formas, siempre con el mismo
2008 Mar 17
4
How does one do simple string concatenation?
How does one convert objects c("a","b","c") and "d" into "abcd"?
> paste(c("a","b","c"), "d")
of course yields
[1] "a d" "b d" "c d"
--
Ajay Shah http://www.mayin.org/ajayshah
ajayshah at mayin.org
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 question is: How do I combine these two!? :-) I have a
2008 Mar 18
3
Puzzled at generating combinations
I have two data frames. Suppose the first has rows
r1
r2
r3
and the second has rows
R1
R2
R3
I'd like to generate the data frame:
r1 R1
r1 R2
r1 R3
r2 R1
r2 R2
r2 R3
r3 R1
r3 R2
r3 R3
How would I go about doing this? I'm sure there's a clean way to do it
but I find myself thinking in loops.
--
Ajay Shah
2006 Mar 06
3
Interleaving elements of two vectors?
Suppose one has
x <- c(1, 2, 7, 9, 14)
y <- c(71, 72, 77)
How would one write an R function which alternates between elements of
one vector and the next? In other words, one wants
z <- c(x[1], y[1], x[2], y[2], x[3], y[3], x[4], y[4], x[5], y[5])
I couldn't think of a clever and general way to write this. I am aware
of gdata::interleave() but it deals