search for: floor_date

Displaying 9 results from an estimated 9 matches for "floor_date".

2016 Dec 06
6
segfault with POSIXlt zone=NULL zone=""
Hi all, I ran into a segfault while playing with dates. $ R --no-init-file ... > library(lubridate); d=as.POSIXlt(floor_date(Sys.time(),"year")); d$zone=NULL; d$zone=""; d Attaching package: ?lubridate? The following object is masked from ?package:base?: date Warning message: package ?lubridate? was built under R version 3.4.0 *** caught segfault *** address (nil...
2013 Mar 13
1
Determining maximum hourly slope per day
...so be great if I could extract when during the day the maximum hourly slope occurred. I have been playing around with using the package lubridate to identify each hour of the day using something like this to create a separate column grouping the data into hours library(lubridate) data$date2 <- floor_date(data$date, "hour") I was then imagining something like this though this code doesn't work as written. ddply(data, .(location, date2), function(d) max(rollapply(slope(d$temp~d$date, data=d))) Essentially what I'm imagining is calculating the slope (though I'd have to write a...
2008 Oct 11
1
problem with cut.Date/date plotting in ggplot2
...lot2) tdat <- data.frame(date=seq.Date(as.Date("2008-07-07"), as.Date("2008-10-10"),by="day"), x=1:96) q2 = qplot(date,x,data=tdat,geom="smooth") print(q2+geom_point()) I can track the problem down to a call like floor_date(as.Date("2008-07-07"),"weeks") and digging further in, I can narrow it down to the issue above.
2016 Dec 06
1
segfault with POSIXlt zone=NULL zone=""
...600 writes: > On Tue, Dec 6, 2016 at 6:37 AM, <frederik at ofb.net> wrote: >> Hi all, >> >> I ran into a segfault while playing with dates. >> >> $ R --no-init-file >> ... >> > library(lubridate); d=as.POSIXlt(floor_date(Sys.time(),"year")); d$zone=NULL; d$zone=""; d >> > If you're asking about a bug in R, you should provide a *minimal* > reproducible example (i.e. one without any package dependencies). > This has nothing to do with lubridate, so you can repro...
2016 Dec 06
0
segfault with POSIXlt zone=NULL zone=""
On Tue, Dec 6, 2016 at 6:37 AM, <frederik at ofb.net> wrote: > Hi all, > > I ran into a segfault while playing with dates. > > $ R --no-init-file > ... > > library(lubridate); d=as.POSIXlt(floor_date(Sys.time(),"year")); d$zone=NULL; d$zone=""; d > If you're asking about a bug in R, you should provide a *minimal* reproducible example (i.e. one without any package dependencies). This has nothing to do with lubridate, so you can reproduce the behavior with: d <- as....
2016 Dec 06
0
ok to segfault with POSIXlt zone=NULL zone=""?
...ty check to prevent this from occurring. Thank you, Frederick On Tue, Dec 06, 2016 at 04:37:20AM -0800, frederik at ofb.net wrote: > Hi all, > > I ran into a segfault while playing with dates. > > $ R --no-init-file > ... > > library(lubridate); d=as.POSIXlt(floor_date(Sys.time(),"year")); d$zone=NULL; d$zone=""; d > > Attaching package: ?lubridate? > > The following object is masked from ?package:base?: > > date > > Warning message: > package ?lubridate? was built under R version 3.4.0 &...
2012 Dec 17
0
User defined functions error - where is it ?
...fter.sub): > states.trends(per.after.sub,'CUST_SINCE') Error in if (d.length%%d.length2 != 0) { : missing value where TRUE/FALSE needed > traceback() 5: update.POSIXct(x, mdays = 1, hours = 0, minutes = 0, seconds = 0) 4: update(x, mdays = 1, hours = 0, minutes = 0, seconds = 0) 3: floor_date(x[[w]], "month") at #15 2: trend.generator(x, "STATE", vec.states[i, 1], y) at #4 1: states.trends(per.after.sub, "CUST_SINCE") I use several tables: 1) full1, which contains data from 2009 to 2012 2) per2012.sub, which is a subset of full1 based on the criterion:...
2017 Aug 03
1
climate data-set; aggregate date (day)
Hi there, I am trying to get the sum of rain per day. That is what the data-set looks like: Timestamp Rain_mm_Tot 2017-05-29 23:40:00 4.7999980 2017-05-29 23:50:00 1.2000000 2017-05-30 00:10:00 2.5800000 2017-05-30 00:20:00 1.2009600 2017-05-30 00:30:00 1.2000006 2017-05-30 00:40:00 2.5002480 First I tried to define the
2014 Mar 15
0
allocation error and high CPU usage from kworker and migration: memory fragmentation?
...parent=parent, timevar=timevar, by=by)) reduction_function <- function(filename, upc, parent, timevar, by, save.dir=NA) { load(filename) # imports move a potentially large data.table (memory size 10 MiB-50 GiB) move[, c(timevar, 'year') := list(floor_date(week_end, unit=timevar), year(week_end))] move <- merge(move, upc, by=c('upc')) # adds is_PL column, a boolean move <- merge(move, parent, by=c('store', 'year') # adds parent column, an integer setkeyv(move, by)...