similar to: Converting a 'difftime' to integer - How to???

Displaying 20 results from an estimated 800 matches similar to: "Converting a 'difftime' to integer - How to???"

2015 May 28
3
S4 inheritance and old class
Hey everyone, I would like to develop a package using S4 classes. I have to define several S4 classes that inherits from each others as follow: # A <- B <- C <- D I also would like to define .DollarNames methods for these class so, if I have understood well, I also have to define an old class as follow: # AOld <- A <- B <- C <- D setOldClass(Classes = "AOld")
2012 Jul 31
1
TimeStamps to seconds
Dear all, I am having a matrix that stores data information in the following format. > roofPart1$TimeStamps[1:5,]      [,1] [,2] [,3] [,4] [,5]   [,6] [1,] 2011    7   21   15   25 20.609 [2,] 2011    7   21   15   25 23.265 [3,] 2011    7   21   15   25 26.000 [4,] 2011    7   21   15   25 28.671 [5,] 2011    7   21   15   25 31.343 I would like to be able to report some simple statistics
2002 Oct 17
4
Posix Problem, difftime
I am having a series of problems using date time data that has been converted into a POSIXt and POSIXlt classes. I have hourly time series data from 1900 that has been converted from text data. I assume most of my problems come from a mis-underdanding of the POSIX class. My matrix named (aa) for this year is approx 8700 by 4. When I try to calculate the length of posit column ( which is the
2006 Nov 03
2
Installing a package - and making it work?
Dear list - Propoerly a beginner question, so bare with my frustration... I tried install the 'shapefiles' package into R 2.4.0 but it seems that the install had little effect... > install.packages(c("shapefiles")) --- Please select a CRAN mirror for use in this session --- trying URL
2011 Jan 27
1
normalizing prizes to a specific year - how to?
Dear list I have a large data frame with house prices. Prices have been converted to price per m2, to be able to compare. Prices are spread over almost 10 years, each price is tagged with the year it relates to. I would like to 'normalize' all the prices to, eg. 2010 prices. The data frame looks like this > head(dafP) Y P 1 2004 11199.60 2 2005 15310.10 3 2005 19491.50 4
2008 Jun 10
2
How to join data.frames and vectors of different length, in an inteligent way?
I have a data set something like this: "YYYY", "Value" 1972 , 117 1984 , 73 1969 , 92 1976 , 113 1999 , 80 1996 , 78 1976 , 98 1984 , 106 1976 , 99 it could be created with: > dafSamp <- data.frame(cbind(c(1972,1984,1969,1976,1999,1996,1976,1984,1976),c(117,73,92,113,80,78,98,106,99))) The real dataset is of cause much larger, app. 100.000 samples
2008 Oct 17
2
Text (eg. summary) to text file, Howto?
Simple question... I would like to dump some summries of lm()'s to small seperate text files. I have looked at: print(), but it don't support output to file cat(), but it claims that 'sum1' is a list write, but that just uses cat()... The script goes something like this: ... lmMax <- lm(NUMAMMON ~ YYYY*MM*DD) sum1 <- summary(lmMax) # help needed here... how to dump sum1
2012 May 09
1
Paquete Spatstat
Hola a toda la comunidad R, el siguiente problema tengo para hacer funcionar el paquete Spatstat. Tengo instalado R version 2.15.0, y Ubuntu 12.04 los cuales ya lo actualice. El paquete (spatstat) esta instalado pero puntualmente es problema es asi: / > library("spatstat") Loading required package: mgcv Error : .onLoad failed in loadNamespace() for ''Matrix'',
2008 Jan 10
2
how to calculate time offset between timezones?
#QUESTION# Is there a way to calculate the offset between timezones, e.g. from "AST" to "GMT"? #DETAILS# I am working with data files that use local time, and that indicate the timezone by e.g. "AST" (Atlantic Standard Time, my local time) in a header. I was guessing that > ISOdatetime(2008,1,1,1,0,0,tz="GMT") - >
2005 Oct 25
2
strptime problem for 2004-10-03 02:00:00
Hello, I at first thought this was a system or locale issue, but since it occurs on both Windows and Linux and only for 2004 (AFAIK) I report it. I have a problem with as.POSIXct for the hour between "2004-10-03 02:00:00 GMT" and "2004-10-03 02:59:59 GMT". In short, the 2 AM (GMT) hour in 2004 (but not in other years) is interpreted as 1 AM by strptime: (I use ISOdatetime
2009 Feb 10
3
ISOdatetime gives NA for a specific date
Hi all, I am using ISOdatetime, and I just found out that when I do ISOdatetime(1995,03,26,2,10,0) (or any other value under minutes or seconds) I get NA This does not happen with the same time in other dates, nor with different hours in the same date. Any hint why this happens? Using R 2.8.1 under ESS/GnuEmacs under Windows XP Pedro -- View this message in context:
2009 Feb 10
2
Strange behaviour of ISOdatetime
Hi All, I am watching a strange behaviour of ISOdatetime. In my work computer, I get NA when I try to do > ISOdatetime(1995,03,26,2,0,0) [1] NA But on other dates and/or times (hour) works OK > ISOdatetime(1995,03,25,2,0,0) [1] "1995-03-25 02:00:00 GMT" In my home computer, I do not have this problem. I am running the same version of R (2.8.1 patched) on both machines, the
2009 Jan 19
1
maptools, sunriset, POSIX timezones
Hi ... I wonder if anyone can provide some insight into why the first three examples using the sunriset function (appended below, with results) give the correct answer, but the fourth generates and error. The first two use ISOdatetime with and without a time zone attribute, and the sunriset function returns the correct sunset time. The third and fourth adds 10 seconds to the ISOdatetime
2004 Apr 29
1
Entering times around the start of daylight savings time
I'm having problems entering dates and times around when daylight savings time starts. If I type (on R 1.8.1 on Gentoo Linux) > ISOdatetime(2004,4,4,0:4,0,0,"GMT") [1] "2004-04-03 19:00:00 EST" "2004-04-03 20:00:00 EST" [3] "2004-04-03 22:00:00 EST" "2004-04-03 22:00:00 EST" [5] "2004-04-03 23:00:00 EST" Giving the times
2012 Jan 20
2
Incorrect DateTime using ISOdatetime in R
Dear list, I need to transform the DateTime of my GPS data from: "666.1751" into "yyyy/mm/dd hh:mm:ss" I have the following code: d$Date <- ISOdatetime(2009, 1, 1, 0, 0, 0, tz = "GMT")+d$Date*(24*3600) This gives me: 2010-10-29 04:12:09, which is wrong. It should be 2010-10-29 06:12:09 Another example: 418.3219 corresponds to: 2010-02-23 07:43:30, but it
2002 Nov 25
2
Q: Segmentation fault at all commands ?
Dear List Sorry if this is trivial, but I can't find it in the manual, FAQ or mail list (2002). I just installed R 1.6.0 (2002-10-01) on Linux R.H. 7.2 (2.4.9-32.5) on an DIGITAL AlphaServer 800 5/500 The program starts up nicely but exits immediately with a "Segmentation fault" at the first command. It seems that it doesn't matter what command, I tried q(), help(), version,
2012 Aug 15
1
Build from Source fails on Loading required package Matrix
Hello: I am building R 2.15.1 from source on a Windows 7 machine with the x64 toolset, MixTeX, and InnoSetup per http://cran.r-project.org/bin/windows/Rtools/. I obtained the source for 2.15.1 via svn from https://svn.r-project.org/R/branches/R-2-15-branch/. This is my first try building R from source. The build seems to go far, then terminates with "undefined exports: .M.classEnv" from
2011 Dec 14
1
A Question Re ISOdatetime
Dear all, I am using the ISOdatetime function like this: test.info$TradeTime = with(test.info, mapply(FUN = ISOdatetime, Year, Month, Day, Hour, Minute, 60, "EST")) Where Year, Month etc are all numeric. I think ISOdatetime should return a POSIXct object. However, the result I obtained from the line above is all numeric. Could you please advise? I wish to get POSIXct. Thank you
2005 Aug 27
2
zoo, zooreg, & ISOdatetime
I create a zooreg object that runs from Jan-1-2002 0:00 to Jun-1-2005 0:00... regts.start = ISOdatetime(2002, 1, 1, hour=0, min=0, sec=0, tz="") regts.end = ISOdatetime(2005, 6, 1, hour=0, min=0, sec=0, tz="") regts.zoo <- zooreg( NA, regts.start, regts.end, deltat=3600 ) Upon inspection: > regts.zoo[1:3] 2002-01-01 00:00:00 2002-01-01 01:00:00 2002-01-01 02:00:00
2012 Jul 19
1
as.POSIXct questions
The following three calls all produce the same result (my machine is in EST): > as.POSIXct(0, tz="", origin=ISOdatetime(1970,1,1,10,0,0)) [1] "1970-01-01 10:00:00 EST" > as.POSIXct(0, tz="EST", origin=ISOdatetime(1970,1,1,10,0,0)) [1] "1970-01-01 10:00:00 EST" > as.POSIXct(0, tz="GMT", origin=ISOdatetime(1970,1,1,10,0,0)) [1]