Questions tagged [posixct]

In the R language, the classes "POSIXct" and "POSIXlt" are representing calendar dates and times (to the nearest second).

The classes POSIXct and POSIXlt are representing calendar dates and times in R.

The class POSIXct represents the (signed) number of seconds since the beginning of 1970 (in the UTC timezone) as a numeric vector.

Class POSIXlt is a named list of vectors representing

  • sec: seconds (0-61)
  • min: minutes (0-59)
  • hour: hours (0-23)
  • mday: day of the month (1-31)
  • mon: months after the first of the year (0-11)
  • year: years since 1900
  • wday: day of the week, starting on Sunday (0-6)
  • yday: day of the year (0-365)
  • isdst: Daylight Savings Time flag. Positive if in force, zero if not, negative if unknown.

POSIXct is more convenient for including in data frames, and POSIXlt is closer to human-readable forms. A virtual class POSIXt exists from which both of the classes inherit.

References:

1056 questions
0
votes
1 answer

Google Vis Timeline aggregation

How can I modify this code to have an aggregated view in the timeline? I don't want to have three different lines just for avocado. I want to have one line just for when avocado exists. Preferably I even want to have one line for the whole data…
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
0
votes
0 answers

as.POSIXct assigns different timezones

I am importing a simple timestamp file with the structure "%Y-%m-%d %H:%M:%S" , i.e. "2014-10-26 04:15:32". A sample data set: tz <- c("2014-10-26 00:27:14", "2014-10-26 00:42:14", "2014-10-26 00:57:14", "2014-10-26 01:12:14", "2014-10-26…
Boris Nikolov
  • 55
  • 2
  • 8
0
votes
1 answer

R: Posix (Unix) Time Crazy Conversion

Unix time is 1435617000. as.Date(1435617000,origin="01-01-1970") [1] "3930586-11-23" Which is wrong. I'm trying to (a) get the correct date, which, per epoch converter is GMT: Mon, 29 Jun 2015 22:30:00 GMT. How do I get R to tell me the month,…
tomchi
  • 11
  • 2
0
votes
1 answer

Conversion to POSIXct from integral number in R

Sorry if this is not a good question. I am working with a time series and I want to convert the integral time format downloaded in a file like "20150710" to the POSIXct time format which is the absolute number of seconds from the origin…
user45668
  • 31
  • 5
0
votes
2 answers

Convert rownames of a matrix from character to POSIX

I don't know how to convert the rows of a matrix in R from character to POSIXt or another similar class. These are my character rows: [1] "2015.07.06 13.41.00.033" "2015.07.06 13.40.00.033" "2015.07.06 13.39.00.033" [4] "2015.07.06 13.38.00.033"…
Michele Della Mea
  • 966
  • 2
  • 16
  • 35
0
votes
2 answers

R add specific (different) amounts of times to entire column

I have a table in R like: start duration 02/01/2012 20:00:00 5 05/01/2012 07:00:00 6 etc... etc... I got to this by importing a table from Microsoft Excel that looked like this: date time …
Zachary Weixelbaum
  • 904
  • 1
  • 11
  • 24
0
votes
1 answer

R rounds time to date

By loading a table of PostgreSQL (RPostgreSQL) time rounds to date. Instead, "2015-01-28 03:04:01 CET" have "2015-01-28 CET", but it is the class "POSIXct" "POSIXt", not only shows, but actually "2015-01-28 00:00:00 CET". And it is only on the local…
Shen
  • 183
  • 1
  • 10
0
votes
3 answers

How to create multi-panels plots with scatterplot/xyplot and POSIX time objects?

A newbie question. (ADDED NEW INFO) I have a set of time stamped data that were collected randomly. I like to create a matrix of plots, but I could not create using either scatterplot or xyplot & time objects. my data dataset$Time #POSIX time…
user186477
  • 1,039
  • 3
  • 11
  • 13
0
votes
0 answers

Loaded time is without hours, minutes and seconds

i load on local computer (Mac) with RPostgreSQL file from PostgreSQL and i have time instead of "2015-02-03 12:12:12" "2015-02-03". i need true time, please help. library(RPostgreSQL) command <- "SELECT * FROM xxx;" xxx <- dbSendQuery(con,…
Shen
  • 183
  • 1
  • 10
0
votes
2 answers

How to filter or subset specific date and time intervals in R? Lubridate?

I have a dataset consisting of two columns. A datetime column and a column with numerical values. Its a simple dataset, so I did not attach it.. What I need to do, is to filter or subset the data corresponding with a class schedule, so that I get a…
Anna Heebøll
  • 101
  • 2
  • 15
0
votes
1 answer

Disappearing seconds when time becomes midnight

I had some code that takes in a time and then takes a way a set number of seconds. All works fine apart from an edge case where when you take away the number of seconds you end up at midnight. In the code I am using when this situation occurs, the…
0
votes
0 answers

Does fasttime cache values outside of it's environment? If so, why?

DISCLAIMER: I assume 'cache' and 'environment' are the right words here, though I am new to programming, so I may have misunderstood the terminology. I have recently been trying to get to grips with the package fasttime for R, and I realise know…
DaveRGP
  • 1,430
  • 15
  • 34
0
votes
1 answer

How to get date class and POSIXCt give the same result

I am reading in some numbers from excel that are the numeric version of a date. Excel displays 42094 as 3/31/15 (or some variant depending how the Date is structured. as.Date(42094,origin = "1899-12-30") produces "2015-03-31". The choice of origin…
0
votes
1 answer

speeding up as.POSIXct with large data / issue with storing as POSIXct in data.table

I am trying to extract a list of POSIXct login times from a large .csv (~11m rows), then use the cut function to tabulate the number of logins per 15-minute block. Given the size of the dataset, I am using the data.table function. I have managed to…
ethane
  • 319
  • 3
  • 7
  • 13
0
votes
1 answer

missing :00 values from date-time string

I have a large date-time series (%Y-%m-%d %H:%M:%S) that reads as follows: [1] 2009-10-16 00:04:30 2009-10-16 00:04:40 2009-10-16 00:04:50 2009-10-16 00:05 [5] 2009-10-16 00:05:10 2009-10-16 00:05:20 Basically the time increments by 10 secs in…