Questions tagged [chron]

An R package for Chronological objects which can handle dates and times, written by David James.

111 questions
2
votes
2 answers

Missing functions from chron package

The CRAN documentation for the chron package has the function trunc.times(). However, even after updating and reloading the chron package in R, no such function is found. Has this function been removed and the documentation just hasn't been updated…
C. Denney
  • 577
  • 4
  • 16
2
votes
1 answer

Is scale_x_chron broken in ggplot2 2.2.1 and R 3.5.0?

If I run the example in ?scale_x_chron: if(require("ggplot2")) { dd <- data.frame(tt = chron(1:10), value = 101:110) p <- ggplot(dd, aes(tt, value)) + geom_point() + scale_x_chron(format = "%m-%d") print(p) } I get Error in…
Javi_VM
  • 505
  • 2
  • 10
2
votes
1 answer

R chron %in% comparison only recognizes every second date

I am using zoo and chron packages in R to read and transform data. At one point I need to select a part of a chron-indexed zoo object which corresponds to another chron object. Unfortunately, using %in% operator I only get part of the corresponding…
NicoH
  • 1,240
  • 3
  • 12
  • 23
2
votes
1 answer

Possible bug on R with chron and sapply

I have a problem with R, a chron object and sapply function. I changed the default origin: chron_start <- chron("01/01/2010", "00:30:00",origin.=c(month=1, day=1, year=1900)) ch <- chron_start+(0:(365*24-1))/24 Now, if I run: > sprintf("%s",…
Javi_VM
  • 505
  • 2
  • 10
2
votes
1 answer

Selecting a time period with window in R; format "dd/mm/yyyy h:m:s" (Windows 7)

I have the following problem. I wanted to use the following code to select a specific time period for daily data, for instance this one: window(Modellwind.zoo, start = as.Date("01/Jan/2001 12:00:00"), end = as.Date("4/Jan/2001 12:00:00")) I get the…
Nucore
  • 107
  • 1
  • 13
2
votes
1 answer

weekend dates within an interval R

I'm trying to identify whether or not a weekend fell within an interval of dates. I've been able to identify if a specific date is a weekend, but not when trying to look at a range of dates. Is this possible? If so, please advise.…
yokota
  • 1,007
  • 12
  • 23
2
votes
1 answer

Command died with status 255 5.3.0- Email to SMS

I receive the following error when trying send emails via a distribution list e.g email to SMS: This is the mail system at host email-to-sms-0x.xxx.com. I'm sorry to have to inform you that your message could not be delivered to one or more…
Ali G
  • 25
  • 4
2
votes
1 answer

Time Series plot with "times" in y-axis

Suppose I have some completion times for an event. completion_data <- data.frame( date=c("2009-05-04", "2010-04-07", "2011-04-02", "2011-05-06", "2012-06-03", "2012-07-09", "2013-09-03", "2014-02-01"), time_taken=c("1:53:01",…
nathanesau
  • 1,681
  • 16
  • 27
2
votes
1 answer

In using timeDate R package, I receive an error when specifying GBNewYearsEve

IN looking for a way to modify the .Holiday object in the chron package I discovered this solution How to define holidays for is.holiday() chron package in R Which works very well in itself, except when I include "GBNewYearsEve" in hlist, I recieve…
DaveRGP
  • 1,430
  • 15
  • 34
1
vote
1 answer

calculating yearly average based on monthly data

hope you can help me out with this: I´m currently plotting climate data (see pic for structure) in R. Therefore I´m trying to calculate the yearly average for 45 years based on monthly means. Calculating the yearly mean based on the monthly values…
Tapex
  • 11
  • 1
1
vote
1 answer

Execution date in the Kubernetes Job name created by CronJob

At the moment my daily Kubernetes CronJob creates job instances with a name with the following pattern: my-chron-job-28038600-acddef my-chron-job-28038660-acddef my-chron-job-28038720-acddef I was wondering, if there is an easy way to override this…
Attila
  • 3,206
  • 2
  • 31
  • 44
1
vote
2 answers

Formatting numeric values to time in R

I want to format my numeric sleep minutes in a data frame to time in R. For example, this is what the data frame looks like: TotalMinutesAsleep 327 sleep.day.1$TotalMinutesAsleep <- hms(sleep.day.1$TotalMinutesAsleep) I…
Baccara
  • 13
  • 2
1
vote
0 answers

Overcome tibble error: Error: All columns in a tibble must be vectors. x Column `solar.time` is NULL

unsure if this is a problem due to Tidyverse or my code, but I am receiving this error message while trying to run a bayesian model with my data. The data in question was first coded from excel time using chron and then to POSIXct solar time, which…
Abigail
  • 19
  • 3
1
vote
1 answer

About chron time matching in r

I try to match two files by using the time column in r. Therefore, I choose chron time to achieve this. But when I try to convert the 'Time' column to chron time, I got the warning message that 'In convert.dates(dates., format = format[[1]], origin.…
LEE
  • 316
  • 2
  • 8
1
vote
1 answer

Conditionally Add 12 hours to column

Using library(chron) Here is the df <- structure(list(Time = structure(c(0.376736111111111, 0.376666666666667, 0.376435185185185, 0.376354166666667, 0.376319444444444, 0.376284722222222, 0.376134259259259, 0.376122685185185, 0.376006944444444,…