similar to: Subtracting POSIXct data/times

Displaying 20 results from an estimated 60 matches similar to: "Subtracting POSIXct data/times"

2000 Mar 22
4
density ellipses?
Hello, has anybody written a function to plot density ellipses (95%, 99% or anything) in a scatterplot? I found nothing in any package, nor in the list archives. There does seem to be a contributed package "ellipse" for S-Plus (on S-Archive), but it does a lot more than what I would need. Still, if anybody ported it to R, I'd be grateful for a link. I'm a bit afraid to try the
2011 Sep 12
1
as.POSIXct on vector weird output
I don't know R, so maybe I've done something wrong, but I'm working off an example I saw on the web and wondering why as.POXIXct isn't returning the same result on f$V1 as it is on z. Did I do something wrong? Or is it a problem with my build? > f$V1 [1] 09/11/2011 13:46:39 09/11/2011 13:45:18 09/11/2011 13:44:58 [4] 09/11/2011 13:40:02 09/11/2011 13:37:58 09/11/2011
2013 Jul 24
0
subtracting rows for unique
Hi, Try: dat1<- read.table(text=" ID Date x2 x1????????? x3 56 25-Jun-01 10 2? 126 56 29-Oct-01 10 2? 140 56 18-Mar-02 10 2? 445 56 6-Jun-03 10 2??? 224 56 16-Jan-04? 10 2??? NA 58 10-Jan-02 10.8 1 715 58 26-Dec-03 10.8 1??? NA ",sep="",header=TRUE,stringsAsFactors=FALSE) ?unlist(with(dat1,by(as.Date(Date,format="%d-%b-%y"),ID,FUN=function(x)
2004 May 26
2
Subtracting number of days from a date
Hi group, suppose I have a date, say May 15 2004, and I want to now what date it is 23 days before that date. The way to calculate the new date should (...) take account of leap years :) In pseudocode: olddate <- "May 15 2004" newdate <- olddate-23 I looked around in POSIXct etc..., maybe I overlooked? Thanks, Maarten
2019 Sep 30
1
Re: [PATCH nbdkit v2 1/4] common/include: Add function for subtracting struct timeval.
On 9/28/19 3:02 PM, Richard W.M. Jones wrote: > --- > common/include/test-tvdiff.c | 75 +++++++++++++++++++++++++++++------- > common/include/tvdiff.h | 13 ++++++- > 2 files changed, 74 insertions(+), 14 deletions(-) > ACK > int > -main (void) > +main (int argc, char *argv[]) Not sure this part matters, but doesn't hurt either. > +++
2010 Feb 02
1
Subtracting time series
Hi all, I've got a time series object (xts) called table. Table contains closing price and volume for each market day of 2009 on a given equity. I'd like to get another xts object, say table2, that contains for each market day holds the close of that day minus the close of the day before and the volume of that day minus the volume of the day before. So table2 <- table[x,] -
2010 Feb 19
1
Subtracting one based on an If
For the following: Bldgid<-c(1000,1000,1000,1001,1002,1003,1003,1003) Maplot<-c(20000,20001,20002,30000,30001,40000,40001,40002) Area<-c(40,170,160,50,100,100,90,110) #Construct Sample dataframe MultiLotBldgs..<-data.frame(Bldgid,Maplot,Area) CondoLots_ <- tapply(MultiLotBldgs..$Maplot, MultiLotBldgs..$Bldgid, length) CondoLots_ Returns: 1000 1001 1002 1003 3 1 1
2013 Sep 10
1
Subtracting elements of a vector from each other stepwise
I am trying to figure out how to create a loop that will take the difference of each member of a vector from each other and also spit out which one has the least difference. I do not want the vector member to subtract from itself or it must be able to disregard the 0 obtained from subtracting from itself. For example: x = c(17,19,23,29) 1. abs(x-x[1]) = (0, 2, 6, 12) 2. abs(x-x[2]) = (2, 0,
2007 Sep 24
2
a bug when subtracting vectors?
Hi, I am calling in some data into R via the read.table function. The 'tail' of this data reads > tail(data) Date Open High Low Close Volume 3728 Fri 14-Sep-07 114.19 114.46 113.93 114.08 1117992 3729 Mon 17-Sep-07 113.99 114.37 113.91 114.27 899671 3730 Tue 18-Sep-07 114.30 114.32 113.47 113.85 1346282 3731 Wed 19-Sep-07 113.71 113.71
2011 May 25
1
Subtracting rows by id
Dear R users, I have two datasets: id1 <- c(rep(1,10), rep(2,10), rep(3,10)) value1 <- sample(1:100, 30, replace=TRUE) dataset1 <- cbind(id1,value1) id2 <- c(1,2,3) subtract.value <- c(1,3,5) dataset2 <- cbind(id2, subtract.value) I want to subtract the number of rows in the subtract.value that corresponds to the id value in dataset1. So for the 1 in id1, I want to
2019 Sep 28
0
[PATCH nbdkit v2 1/4] common/include: Add function for subtracting struct timeval.
--- common/include/test-tvdiff.c | 75 +++++++++++++++++++++++++++++------- common/include/tvdiff.h | 13 ++++++- 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/common/include/test-tvdiff.c b/common/include/test-tvdiff.c index 9cbcfc0..abefb2e 100644 --- a/common/include/test-tvdiff.c +++ b/common/include/test-tvdiff.c @@ -36,7 +36,6 @@ #include <stdlib.h> #include
2005 Nov 15
2
Subtracting timeseries objects
Sorry to keep posting but I want to do this right and I'm hoping for some pointers I now have two time series objects which I need to subtract. Unfortunatly the two series dont have the same sample rates. When I try to subtract them avgSub<-avg1-avg2 The time series object is clever enough to object. So I guess I need to write a function for subtraction of the time series objects which
2010 Sep 03
1
Incorrect formatted output after subtracting non-integer seconds from POSIXt origin
> x<-as.POSIXct("1970-1-1", tz="UTC")-.5 > y<-as.POSIXct("1970-1-1", tz="UTC")+.5 > x==y [1] FALSE # of course but x and y "appear" to be the same when formatted, even with extra precision: > format(x, format="%Y-%m-%d %H:%M:%OS2") [1] "1970-01-01 00:00:00.50" > format(y, format="%Y-%m-%d
2005 Oct 30
1
Help with Subtracting an effect from a Mixed Model
Hi Everyone, I posted a similar question about a week ago, but haven't gotten any replies -- I'm afraid that's because my previous question was too vague. Let me try again with a more specific question, and I hope someone can help. NOTE, I know I should be using the newer lme4 package, I just haven't had a chance to update my version of R yet, so the question below relates
2009 Apr 20
8
bug when subtracting decimals?
Try this: 0.7-0.3==0.4 (We get FALSE) 0.7-0.3<0.4 (We get TRUE) but 0.8-0.3==0.5 (TRUE) 0.8-0.3<0.5 (FALSE) Funny, he? There is a way around: round(0.7-0.3,1)==0.4 (TRUE) Obviously there is a problem with some combinations of decimal subtractions, that - we have the feeling - shouldt be solved. Best regards Sven & Wolfgang -- View this message in context:
2009 Apr 20
8
bug when subtracting decimals?
Try this: 0.7-0.3==0.4 (We get FALSE) 0.7-0.3<0.4 (We get TRUE) but 0.8-0.3==0.5 (TRUE) 0.8-0.3<0.5 (FALSE) Funny, he? There is a way around: round(0.7-0.3,1)==0.4 (TRUE) Obviously there is a problem with some combinations of decimal subtractions, that - we have the feeling - shouldt be solved. Best regards Sven & Wolfgang -- View this message in context:
2011 Jan 25
4
Subtracting elements of data.frame
Dear R helpers I have a dataframe as df = data.frame(x = c(1, 14, 3, 21, 11), y = c(102, 500, 40, 101, 189)) > df    x   y 1  1 102 2 14 500 3  3  40 4 21 101 5 11 189 # Actually I am having dataframe having multiple columns. I am just giving an example. I need to subtract all the rows of df by the first row of df i.e. I need to subtract each element of 'x' column by 1. Likewise I
2012 May 07
5
Subtracting a matrix 1x28 from a scalar
Afternoon- I am trying to subtract a matrix, basically a vector of 28 values, each by the same number to account for differences in regression fitting. I am taking the 1x28 and minus it by the mean value of the matrix, each number. The result I receive is a 1X29 matrix. Does anyone know why the result has an extra value? > lffeb_march [1] 6.588926 7.663877 6.917706 6.824374 7.029973
2013 Apr 29
2
Adding elements in data.frame subsets and also subtracting an element from the rest elements in data.frame
Dear R forum I have a data.frame as cashflow_df = data.frame(instrument = c("ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC", "ABC", "PQR", "PQR",
2019 Sep 28
2
[PATCH nbdkit 1/2] common/include: Add function for subtracting struct timeval.
--- common/include/test-tvdiff.c | 75 +++++++++++++++++++++++++++++------- common/include/tvdiff.h | 13 ++++++- 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/common/include/test-tvdiff.c b/common/include/test-tvdiff.c index 9cbcfc0..abefb2e 100644 --- a/common/include/test-tvdiff.c +++ b/common/include/test-tvdiff.c @@ -36,7 +36,6 @@ #include <stdlib.h> #include