similar to: as.POSIXct on vector weird output

Displaying 20 results from an estimated 10000 matches similar to: "as.POSIXct on vector weird output"

2010 Jun 14
1
Subtracting POSIXct data/times
I have two dataframe columns of POXIXct data/times that include seconds. I got them into this format using for example zsort$ETA <- as.POSIXct(as.character(zsort$ETA), format="%m/%d/%Y %H:%M:%S") My problem is that when I subtract the two columns, sometimes the difference is given in seconds, and sometimes it is given in minutes. I don't care which it is, but I need to know which
2011 Sep 15
1
difftime on vector
How can I apply difftime to a vector of sorted dates? I can do this just fine with diff, but difftime doesn't seem to take in a vector. > diff(r$BOOKING_DATE) Works. Great! > difftime(r$MY_DATE, units="days") Error in as.POSIXct(time2) : argument "time2" is missing, with no default Thanks, Bradford [[alternative HTML version deleted]]
2012 Mar 25
2
Weird POSIXct behaviour
Friends I have an xts that I wish to access. Browse[2]> DATA.ba[[p]]["2012-03-20 00:59:57","bid"] bid 2012-03-20 00:59:57 1.4993 So far so good. Now putting the index into a variable: Browse[2]> Time [1] "2012-03-20 00:59:57 NZDT" Browse[2]> DATA.ba[[p]][Time, "bid"] bid Where has it gone? Looking closer....
2014 Jun 17
1
rJava Java debugger API
Hi, I use rJava and call Java code that uses JVMTI code like this VM vm = VM.getVM(); Universe universe = vm.getUniverse(); CollectedHeap heap = universe.heap(); This code attaches to another JVM and to get its internals. This is legal Java and it works. But when I use rJava to call this code, the call is successfull and it throws an error. I believe there is Java
2011 Aug 08
2
RODBC: sqlUpdate doesn't handle properly POSIXct field?
Hello all! Can someone confirm whether there is a bug or not? I was trying to use sqlUpdate in place of sqlSave as data set I import has duplications. However I get errors while using fast=FALSE argument to safely update/ignore duplicates: Error while executing the query[RODBC] ERROR: Could not SQLExecDirect 'UPDATE "data" SET "logger"=1,
2013 May 03
1
(no subject)
Hi. After I installed R 3.0.0.pkg for mac version , when click the icon R to startup . I receive the annoucement in red color to inform that something wrongs , but I do not know how to fix them . R version 3.0.0 (2013-04-03) -- "Masked Marvel" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin10.8.0 (64-bit) "R is free software and comes
2011 Mar 21
1
Help with POSIXct
I rarely work with dates in R, so I know very little about the POSIXct and POSIXlt classes. I'm importing an excel file into R using the RODBC package, and am having issues reformatting the dates. 1. The important info: > sessionInfo() R version 2.12.2 (2011-02-25) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
2005 Apr 30
2
(PR#7826) segfault during build of 2.1.0 on RH9; print.POSIXct
1) Why did you submit this *twice*, as PR#7826 and PR#7827? Please don't be so careless of the volunteers' time. 2) > print.POSIXct function (x, ...) { print(format(x, usetz = TRUE, ...), ...) invisible(x) } is definitely *not* implicated. (Use of ... in two places is correct.) 3) On FC3: > unusual_and_faults Error: protect(): protection stack overflow >
2005 Apr 30
1
segfault during build of 2.1.0 on RH9; print.POSIXct implicated (PR#7827)
In attempting to build R using rpmbuild --rebuild R-2.1.0-0.fdr.2.fc3.src.rpm on a fairly up-to-date RedHat 9 system (that is, with patches installed through May 1 2004), it failed at the make check-all step. The problem was reproducible by going into the tests directory and make test-Segfault The last lines of the saved file no-segfault.Rout.fail are > > ## c.POSIXct : > >
2009 Sep 11
1
What determines the unit of POSIXct differences?
Dear All, what determines if a difference between POSIXct objects gets expressed in days or seconds? In the following example, it's sometimes seconds, sometimes days. as.POSIXct('2009-09-01') - as.POSIXct(NA) Time difference of NA secs c(as.POSIXct('2009-09-01'), as.POSIXct(NA)) - c(as.POSIXct('2009-09-01'), as.POSIXct('2009-08-31')) Time differences in
2012 Mar 02
3
Generating new application creates a few syntactically bad files in Rails 3.2.1
Running "rails new yourapplicationname" creates all the requisite files, however two of them have bad syntax. session_store.rb is: YourApplicationName::Application.config.session_store :cookie_store, key: ''_yourapplicationname_session'' should be: YourApplicationName::Application.config.session_store :cookie_store, :key =>
2018 May 16
2
Date method of as.POSIXct does not respect tz
R 3.5.0 Is it intended that the Date method of as.POSIXct does not respect the tz parameter? I suggest changing as.POSIXct.Date to this: function (x, tz = "", ...) .POSIXct(unclass(x) * 86400, tz = tz) Currently, the best workaround seems to be using the character method if one doesn't want the default timezone (which is often an annoying DST timezone). This came up on
2012 Aug 24
1
POSIXct-coerced NA's not considered NA by is.na()
Hello folks, I found a strangeness while experimenting with POSIXct vectors and lists. It seems that coerced NA's aren't "real" NAs, at least as considered by is.na()? > date_vec = c(as.POSIXct(now()), as.POSIXct(now()+1),NA,"b") > date_vec [1] "2012-08-22 15:00:46 COT" "2012-08-22 15:00:47 COT" NA [4] NA Warning message: In
2006 Oct 04
2
integers to POSIXct
What is the recommended way to convert/coerce and integer to a POSIXct please? d <- as.POSIXct(Sys.Date()) i <- as.integer(d) as.POSIXct(i) Error in as.POSIXct.default(i) : do not know how to convert 'i' to class "POSIXlt" This appears to be the behaviour in 2.3.1 and 2.4.0 on windows XP. I have tried searching on this and found as.Date.integer in package zoo which
2003 Jun 05
1
question about POSIXct conversion
Hello! I am trying to compute minimal time on some data like this: mt<-tapply(mrsh$time1,list(mrsh$var1,mrsh$var2),min): a b 145 1054800600 1054789800 340 1054804500 1054794600 349 1054820400 1054792800 55 1054800600 1054789200 57 1054814100 1054791000 78 1054822200 1054790400 843
2003 Jan 22
1
Convert numeric value to POSIXct
Hi, How do I convert a numeric value indicating the time since 1970, back into a POSIXct class object? I have tried format.POSIXct and as.POSIXct without success. For example > ccc [1] "1945-01-01 15:00:00 MDT" > ddd<- as.numeric(ccc); > ddd [1] -788842800 > format.POSIXct(ddd) Error in format.POSIXct(ddd) : wrong class > as.POSIXct(ddd) Error in
2012 Jun 15
2
time zones and the chron to POSIXct conversion
Hey R folks, i found some strange (to me) behaviour with chron to POSIXct conversion. The two lines of code result in two different results, on ewith the correct time zone, one without: library(chron) as.POSIXct(chron('12/12/2000'), tz = 'UTC') as.POSIXlt(chron('12/12/2000'), tz = 'UTC') Only the code below would give me a POSIXct object with the correct time
2012 Jan 19
2
POSIXct value display incorrect for some values
First, the reproducable example, showing how converting from character to POSIXct to character changes the milliseconds in the first time stamp though not in the second: > as.POSIXct('2010-06-03 9:03:58.324') [1] "2010-06-03 09:03:58.323 PDT" > as.POSIXct('2010-06-03 9:03:58.325') [1] "2010-06-03 09:03:58.325 PDT" This seems to be due to truncation of
2003 Apr 30
2
ylab in plot.POSIXct
I am using R-1.7.0 and have some data which consist of one vector of numbers and a second corresponding vector of dates belonging to the POSIXct class. I would like to plot the numbers against the dates. What is the best way to do this? It almost works to just call `plot.' However if I do this while using the `ylab' parameter I get a warning message: parameter "ylab"
2003 Sep 02
1
convert character to POSIXct
Dear list-members, I would like to calculate the difference between two points in time. To convert a 'time (GMT)'-character with the format "1/1/1999 01:01:01" into an object of class "POSIXct"', I first use the strptime() as suggested in the details help(as.POSIXct). e.g. starttime<-strptime("1/1/1999 01:01:01",format="%d/%m/%Y %H:%M:%S")