Displaying 20 results from an estimated 1827 matches for "subtraction".
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
...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 will need to interpolate the samples to the same sampling
time (this linear interpolation should be ok here)
I would like to make this function the default one to be used when a ts
subtractin is attempted. Unfortunatly I dont really have much idea where
to start wit...
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
Hello Chandler,
> First and foremost - how do you address correctness issues here? Because
the subtraction `A - B` can escape/capture more things. Specifically, if
one of `A` or `B` is escaped/captured, the
> subtraction can be used to escape or capture the other pointer. So *some*
of the conservative treatment is necessary. What is the plan to update all
the analyses to remain correct? What
> cor...
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
...rel_offset);
> }
> }
> ```
>
> For example, a common loop optimization technique is something like the
following in *pseudocode* (note that this is
> not necessarily valid C but we might reasonably want to express this kind
of optimization within LLVM:
When LLVM need to insert subtraction between two pointers, like the example
you wrote, I believe we can use 'sub(ptrtoint p, ptrtoint q)' as before.
This addresses concerns regarding correctness of existing pointer analysis.
So you don't lose expressiveness, while you gain precision when possible.
A concrete suggestion is...
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
...ere are only 1048 inttoptrs, meaning that 95.4%
of them are generated by LLVM passes.
This trend is similar in ptrtoint instruction as well. When compiling SPEC
2017
with -O0, there are 23,208 ptrtoint instructions, but among them 22,016
(94.8%)
are generated by Clang frontend to represent pointer subtraction.
They aren't effectively optimized out because there are even more ptrtoints
(31,721) after -O3.
This is bad for performance because existence of ptrtoint makes analysis
return conservative
result as a pointer can be escaped through the cast.
Memory accesses to a pointer came from inttoptr is a...
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
On Mon, Jan 14, 2019 at 9:36 AM Chandler Carruth via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> While I'm very interested in the end result here, I have some questions
> that don't seem well answered yet around pointer subtraction...
>
> First and foremost - how do you address correctness issues here? Because
> the subtraction `A - B` can escape/capture more things. Specifically, if
> one of `A` or `B` is escaped/captured, the subtraction can be used to
> escape or capture the other pointer.
>
Isn't es...
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
...column 1 is date information)
> Vsimr <- as.matrix(Vsimr[,-1]) # remove column 1 from analysis thus Vsimr
> is 101x1000 double matrix (column 1 is date information)
> Vobsr - Vsimr
Error in Vobsr - Vsimr : non-conformable arrays
Thus I attempted to create the loop below to perform the subtraction
operation for each of the 1000 columns.
> dim(Vsimr)[2]
[1] 1000
> for (i in 1:dim(Vsimr)[2]) {
Xjj <- Vobsr - Vsimr[,i]
}
Xjj is a 101x1 double matrix rather than a 101X1000 double matrix
How can I subtract each column of Vsimr from the single column of Vobsr over
the 1000 columns...
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
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
...gt;
>>
>> On Mon, Jan 14, 2019 at 9:36 AM Chandler Carruth via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>
>>> While I'm very interested in the end result here, I have some questions
>>> that don't seem well answered yet around pointer subtraction...
>>>
>>> First and foremost - how do you address correctness issues here? Because
>>> the subtraction `A - B` can escape/capture more things. Specifically, if
>>> one of `A` or `B` is escaped/captured, the subtraction can be used to
>>> escape or captu...
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,