search for: subtracting

Displaying 20 results from an estimated 1814 matches for "subtracting".

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
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
2012 Sep 20
4
[PATCH 0/3] tsc adjust implementation for hvm
Intel recently release a new tsc adjust feature at latest SDM 17.13.3. CPUID.7.0.EBX[1]=1 indicates TSC_ADJUST MSR 0x3b is supported. Basically it is used to simplify TSC synchronization, operation of IA32_TSC_ADJUST MSR is as follows: 1). On RESET, the value of the IA32_TSC_ADJUST MSR is 0; 2). If an execution of WRMSR to the IA32_TIME_STAMP_COUNTER MSR adds (or subtracts) value X from the
2019 Jan 14
4
Reducing the number of ptrtoint/inttoptrs that are generated by LLVM
...from >> 31,721 to 7,772 (24.5%). >> >> I'll introduce llvm.psub patch first. >> >> >> --- Adding llvm.psub --- >> >> By defining pointer subtraction intrinsic, we can get performance gain >> because it gives more undefined behavior than just subtracting two >> ptrtoints. >> >> Patch https://reviews.llvm.org/D56598 adds llvm.psub(p1,p2) intrinsic >> function, which subtracts two pointers and returns the difference. Its >> semantic is as follows. >> If p1 and p2 point to different objects, and neither of them is b...
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
2019 Jan 15
2
Reducing the number of ptrtoint/inttoptrs that are generated by LLVM
...>> I'll introduce llvm.psub patch first. >>>> >>>> >>>> --- Adding llvm.psub --- >>>> >>>> By defining pointer subtraction intrinsic, we can get performance gain >>>> because it gives more undefined behavior than just subtracting two >>>> ptrtoints. >>>> >>>> Patch https://reviews.llvm.org/D56598 adds llvm.psub(p1,p2) intrinsic >>>> function, which subtracts two pointers and returns the difference. Its >>>> semantic is as follows. >>>> If p1 and p2 poin...
2011 Jul 27
2
Elegant way to subtract matrix from array
there are really two related problems here I have a 2D matrix A <- matrix(1:100,nrow=20,ncol =5) S <- matrix(1:10,nrow=2,ncol =5) #I want to subtract S from A. so that S would be subtracted from the first 2 rows of #A, then the next two rows and so on. #I have a the same problem with a 3D array # where I want to subtract Q for every layer (1-10) in Z # I thought I solved this one
2019 Jan 14
7
Reducing the number of ptrtoint/inttoptrs that are generated by LLVM
...nttoptrs decreases from 22,771 to 1,565 (6.9%), and # of ptrtoints decreases from 31,721 to 7,772 (24.5%). I'll introduce llvm.psub patch first. --- Adding llvm.psub --- By defining pointer subtraction intrinsic, we can get performance gain because it gives more undefined behavior than just subtracting two ptrtoints. Patch https://reviews.llvm.org/D56598 adds llvm.psub(p1,p2) intrinsic function, which subtracts two pointers and returns the difference. Its semantic is as follows. If p1 and p2 point to different objects, and neither of them is based on a pointer casted from an integer, `llvm.psub(...
2009 Oct 25
2
row subtraction
I don't know if there is a way to do this in R but I want to subtract within the same column from different rows. I want to subtract c(r)-c(r-1) and continue down the column until they are all calculated and form another column. Again I don't know if R can do this but I thought I would ask. Thanks either way
2019 Jan 14
2
Reducing the number of ptrtoint/inttoptrs that are generated by LLVM
...from >> 31,721 to 7,772 (24.5%). >> >> I'll introduce llvm.psub patch first. >> >> >> --- Adding llvm.psub --- >> >> By defining pointer subtraction intrinsic, we can get performance gain >> because it gives more undefined behavior than just subtracting two >> ptrtoints. >> >> Patch https://reviews.llvm.org/D56598 adds llvm.psub(p1,p2) intrinsic >> function, which subtracts two pointers and returns the difference. Its >> semantic is as follows. >> If p1 and p2 point to different objects, and neither of them is b...
2012 Oct 30
3
subtract a time period from a date
Hello everybody, how can I reduce e.g. 30 days from a date? When I do the following "2011-05-01 CEST" -"2011-04-01 CEST" I get: "Time difference of 30 days" an thats fine. But when I try "2011-05-01 CEST" - 30 I get nonsense. So how can I subtract some days, month or years from a date? thanking you in anticipation Claudia Paladini
2012 Nov 19
6
loop to subtract arrays / error
Hi everyone, I am having trouble with creating a loop to subtract arrays. In R, this is what I have done: > Vobsr <- read.csv("Observed_Flow.csv", header = TRUE, sep =",") # see data > below > Vsimr <- read.csv("1000Samples_Vsim.csv", header = TRUE, sep =",") # see > data below > Vobsr <- as.matrix(Vobsr[,-1]) # remove column 1 from
2012 May 07
5
Subtracting a matrix 1x28 from a scalar
...372 1.14807939 0.32976906 1.59201078 [22] 1.59201078 0.92283279 0.59578964 0.54334317 -0.45299027 -1.55160256 -1.92629601 [29] 0.04525657 -1.42827935 -1.75924193 0.54334317 -0.49554989 0.17561839 Thanks for the help Meredith -- View this message in context: http://r.789695.n4.nabble.com/Subtracting-a-matrix-1x28-from-a-scalar-tp4615590.html Sent from the R help mailing list archive at Nabble.com.
2012 Mar 29
2
subtract a list of vectors from a list of data.frames in an elegant way
Dear R experts, I've realized that it might not be possible to define a negative SELCET statement in a SQL call so now I'm looking for the smoothest way to generate a list of what I would like from my large database by first pulling all the names with a query like this "SELECT top 1 * FROM your_table" (thank you Bart Joosen for the idea) and then subtract the variables I am not
2019 Jan 15
2
Reducing the number of ptrtoint/inttoptrs that are generated by LLVM
...alue? >> I mean that if `A` or `B` is escaped/captured, then any pointer that is >> associated to the same memory range should be considered as "escaped", and >> thus the subtraction does not seem to leak anything more to me. >> > > I believe this is true for subtracting "inbounds" (to borrow the gep > terminology), but just as we support non inbounds GEP, we support non > imbounds subtracting. There it seems like this does escape the other > global. I know that in the past I've discussed this exact case with > nlewycky and he believed tha...
2008 Jan 29
2
add/subtract matrices, ignoring NA or missing values
Hi, For example, given two 2x2 matrices m1 and m2. I would like to add/subtract element by element > m1 [,1] [,2] [1,] NA NA [2,] 1 2 > m2 [,1] [,2] [1,] 1 NA [2,] NA 2 > m1 + m2 [,1] [,2] [1,] NA NA [2,] NA 4 How can I ignore the NA, and get this ? Hope the solution can be extended to subtract and modulo also. [,1] [,2]
2008 May 07
3
use list elements to subtract values from the dataframe
Hi, I have a dataframe wf existing of a header with different labels and beneath the values of those labels : wf: label1 label2 ... 0,45 0,21 0,10 0,45 .... .... I have a list fl <- c("label2","label3",..) Isn't possible to use the list elements in the list in order to subtract values from the dataframe? like : wf$fl[[1]] When I do in R I get :NULL
2008 Apr 10
2
subtract the mean from each column
Hi, I am new to R an dI need some help I have a matrix of real values 100*300 and I would like to calculate the mean for each column , then for each entry in a column i need to subtract the mean so I will have a matrix where the columns have zero mean. any one know how to do that . Thanks -- View this message in context:
2013 Jan 14
1
hwo to subtract a child array from the big array?
hi R users I have a data set with the name AA AA<-1:100 Now I want to get a child array from AA every 10 numbers e.g. ab =c(10,20,30,40,50,60,70,80,100) How could I subtract aa from AA? thank you . -- TANG Jie Email: totangjie@gmail.com Tel: 0086-2154896104 Shanghai Typhoon Institute,China [[alternative HTML version deleted]]
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, 4, 10) 3. abs(x-x[3]) = (6, 4, 0, 6) 4. abs(x-x[4]) = (12, 10, 6, 0) The code would then spit out that x[1] and x[2] are the least different, but if there were 2 separate values that were equa...