similar to: a bug when subtracting vectors?

Displaying 20 results from an estimated 60 matches similar to: "a bug when subtracting vectors?"

2010 Dec 23
1
Running sweave automatically using cygwin
Hi all, Hope someone could help me. I am trying to run automatically the conversion of an Rwn file to a tex file. I am using windows 7, and cygwin. I tried to run automatically the Sweave.sh script, in its the most recent version available at R webpage: http://cran.r-project.org/contrib/extra/scripts/Sweave.sh Unfortunately, I got this error message: =========================== Raquel at
2012 Nov 02
1
rgl package and animation
I am trying to figure out how to use rgl package for animation. It appears that this is done using the play3d() function. Below I have some sample code that plots a 3D path and puts a sphere at the point farthest from the origin (which in this case also appears to be at the end of the path). What I would like to do is animate the movement of another sphere along the length of the path
2002 Oct 09
0
R 1.6.0 benchmark with and without optimized ATLAS
Hello, I am updating my benchmark (http://www.sciviews.org/other/benchmark.htm) to recent versions of data analysis software (including R 1.6.0 and Splus 6.1), and I now run it on a Pentium IV instead of the old Celeron 500 Mhz that candidates for retirement. I test R under Windows Xp pro with and without optimized BLAS. I use the optimized Rblas.dll for P4 found on CRAN. Here are the results.
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,
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 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",