similar to: Incompatible methods ("+.Date", "Ops.difftime") for "+"

Displaying 20 results from an estimated 20000 matches similar to: "Incompatible methods ("+.Date", "Ops.difftime") for "+""

2007 Oct 08
2
Incompatible methods ("-.POSIXt", "Ops.difftime") for "-"
Dear all, according to the Help-page of DateTimeClasses {base} I should be able to do time - z with time date-time objects z a numeric vector (in seconds) or an object of class "difftime". However, on R version 2.6.0 (Windows XP) I get > Sys.time() - as.difftime(c("0:3:20", "11:23:15")) Time differences in mins [1] 1191837998 1191837318
2010 May 13
1
cdplot() with 'POSIXct' x
Hi, Given that cdplot() is used to produce the conditional density of a categorical y along a numerical x, it seems natural that it could be used with a date or time x (such as 'POSIXct'). Is this desirable? If so, I've created a patch that would allow this, by coercing the POSIXct x variable to produce the density, but use the original POSIXct x to draw the x axis. Index:
2009 Apr 21
2
multiple plots in same graph window
Hi, I'm trying to make multiple plots in a same graph window in R. The multiple graphs are showing up in the right positions on the window, but I'm having the problem that the graphic window is being refreshed every time a new plot is drawn, so that I end up with only the last graph coming up; the previous ones are all erased If I try to print in a .eps file directly, then I end up
2009 Nov 19
0
In the documentation of 'Ops.Date', please remove mention about "difftime", like in the documentation of 'DateTimeClasses' (PR#14072)
I am sorry to reply. But I need to clarify things.=0A=0AFrom searching over= the internet, I know that, before R 2.5.0, in the documentation of 'DateTi= meClasses', in 'date + x', in the explanation about 'x', there is also ment= ion that 'x' can be a 'difftime' object. Now, it has been removed.=0A=0AWhy= not doing the same in the documentation of
2011 Aug 02
1
lattice: index plot
Dear all, How can I make an index plot with lattice, that is plotting a vector simply against its particular index in the vector, i.e. something similar to y <- rnorm(10) plot(y) I don't want to specify the x's manually, as this could become cumbersome when having multiple panels. I tried something like library(lattice) mp <- function(x, y, ...) { x <- 1:length(y)
2010 Jun 24
1
help, bifurcation diagram efficiency
Hello all - This code will run, but it bogs down my computer when I run it for finer and finer time increments and more generations. I was wondering if there is a better way to write my loops so that this wouldn't happen. Thanks! -Tyler ################# # Bifurcation diagram # Using Braaksma system of equations # We have however used a Fourier analysis # to get a forcing function
2010 Nov 11
3
overlap histogram and density
Hi, Does anybody encounter the same problem when we overlap histogram and density     that the density line seem to shift to the right a little bit?           If you do have the same problem, what should we do to correct that?           Thank you.           par(mar=c(4,4,2,1.2),oma=c(0,0,0,0))     hist(datobs,prob=TRUE, main ="Volume of a catchment from four    
2008 Apr 29
2
help text for xlim
Dear R-developers, A student asked me today of how to specify the limits of the x-axis. I knew that he should use xlim, but I tried to encourage him to have a try himself with the various help functions. I do not judge if he used the correct search strategy or right key words, but anyway here is what he tried: he looked at ?plot. There xlim is not mentioned. He checked ?par. There you find
2007 Mar 22
2
R difftime function: How can we fix the difftime unit?
Hi, I am trying to take difference of two time objects. I want to fix the result's unit to minutes. How can I do that? Here is an example: > difftime(x, y) Time difference of 2.030720 hours > difftime(x, z) Time difference of 30.34672 mins where x = '2007-03-05 08:32:58' y = '2007-03-05 06:31:07' and z = '2007-03-05 08:02:37' How can I get answer
2010 Jun 22
1
New errors with difftime()-objects in 2.11.1 (was Re: Request: difftime method for cut())
On Thu, Jun 10, 2010 at 3:39 PM, Gustaf Rydevik <gustaf.rydevik at gmail.com> wrote: > Hi all, > > The recent change in 2.11 that made as.numeric() return false on > difftime-objects broke some of my code that calculated age classes of > individuals using cut(). While this was no big thing to fix for me, it > might be wise > to provide a cut.difftime method to ?stop
2010 Jun 22
1
New errors with difftime()-objects in 2.11.1 (was Re: Request: difftime method for cut())
On Thu, Jun 10, 2010 at 3:39 PM, Gustaf Rydevik <gustaf.rydevik at gmail.com> wrote: > Hi all, > > The recent change in 2.11 that made as.numeric() return false on > difftime-objects broke some of my code that calculated age classes of > individuals using cut(). While this was no big thing to fix for me, it > might be wise > to provide a cut.difftime method to ?stop
2006 Apr 03
1
weird "max" behavior for difftime class
If you apply the "max" function to a vector of class "difftime" with units="days", the returned value is in units of "seconds". Is this not a bug? At any rate it can lead to confusing results if one buries a call to "max" deep in some data analysis code. Details: > y<-structure(1, class = "difftime", units = "days")
2009 Feb 06
1
Operations on difftime (abs, /, c)
Since both comparison and negation are well-defined for time differences, I wonder why abs and division are not defined for class difftime. This behavior is clearly documented on the man page: "limited arithmetic is available on 'difftime' objects"; but why? Both are natural, semantically sound, and useful operations and I see no obvious reason that they should give an error:
2009 Feb 06
1
Operations on difftime (abs, /, c)
Since both comparison and negation are well-defined for time differences, I wonder why abs and division are not defined for class difftime. This behavior is clearly documented on the man page: "limited arithmetic is available on 'difftime' objects"; but why? Both are natural, semantically sound, and useful operations and I see no obvious reason that they should give an error:
2013 Jul 09
1
Is difftime a "class"
I am trying to write S4 methods with "difftime" in the signature but am being "informed" (? not a warning or error) that "difftime" is not a class. Nevertheless, dispatch takes place. Should I simply ignore that "information"? Here is a toy example: > setClass("foo", contains = "Date") > setMethod("+", c("foo",
2017 Jul 06
1
Convert date to continuous variable in R
Thanks it worked for me. I wanted to plot days since planting on x-axis 1 and years on x-axis 3. LAI_simulation$Date <- as.Date( LAI_simulation$Date, '%Y/%m/%d') LAI_simulation$Date <- as.integer(LAI_simulation$Date - as.Date("2009-10-07")) plot(LAI~Date,data=LAI_simulation,xlab="Days since Oct, 7,
2011 Oct 25
2
difftime producing NA values in R 2.12.2
R-listers, I have noticed several posts on issues with difftime producing NA's but they have been for older versions of R. Here's the issue associated with difftime that I am dealing with in R 2.12.2. > preciptime = strptime("01/10/2007 14:00",format="%m/%d/%Y %H:%M") > class(preciptime) [1] "POSIXlt" "POSIXt" > # Now using difftime, this
2018 Aug 01
1
RFC: make as.difftime more consistent or convenient
Hello! you, Emil Bode <emil.bode at dans.knaw.nl>, wrote on Tuesday, July 31, 2018 1:55 PM: > Some of the changes you're proposing could be made (with effort), but note that you're not > restricted to providing strings with a format. > What you're trying to do can be accomplished with as.difftime(12, units='weeks'), see also > ?as.difftime > > Or if
2010 Apr 05
1
using difftime()
I'm new to R and have the following problem with difftime: if I directly assign date/time strings in difftime I get the expected result: > a<-"2010-03-23 10:52:00" > a [1] "2010-03-23 10:52:00" > b<-"2010-03-23 11:53:00" > u2<-as.difftime(c(a,b), format ="%Y-%m-%d %H:%M:%S", units="mins") > u2 Time differences in mins
2007 Feb 21
1
Adding difftime objects to POSIXt objects
Hello, ?DateTimeClasses states that "one can add or subtract a number of seconds or a 'difftime' object from a date-time object, but not add two date-time objects." So, is the below expected behavior? > x <- Sys.time() > x [1] "2007-02-21 16:19:56 CST" > x + as.difftime("1","%H") [1] "2007-02-21 16:19:57 CST" Warning