similar to: Sum over indexed value

Displaying 20 results from an estimated 600 matches similar to: "Sum over indexed value"

2009 Nov 17
1
Add "bin" variable to dataframe
Hi All - I am trying to add a new variable to my dataframe which is a series of bins based on another variable which is distance. So, I'd like to end with each of my distances classified into bin 1, bin 2, bin 3 etc. Below is a start. x<-rnorm(100, mean=100, sd=30) #Generates sample distances breaks = seq(0, 200, l = 11) #Generates 10 bins of equal distance (i.e. 20km) Any ideas?
2010 Feb 18
2
Funny result from rep(...) procedure
I'm observing odd behavior of the rep(...) procedure when using variables as parameters in a loop. Here's a simple loop on a vector 'branches' that is c(5,6,5,5,5). The statement in question is print(c(ni,rep(i,times=ni))) that works properly first time through the loop but the second time, when branches[2] = 6, only prints 5 values of i. Any ideas, anyone? iInd = 1
2001 Jun 12
2
a problem with rep() ?
Colleagues ---------------------------------- System info: Version 1.2.3 (2001-04-26) on NT ESS v. 5.1.18 using emacs ver. 20.4 ---------------------------------- I am wondering if there is a problem with the function rep(). Both the commands using rep() below were expected to produce 8 twos, but only the second did. x <- rep(2,40*(1-0.8)) length(x) y <- rep(2,40*0.2) length(y)
2009 Jul 23
3
Counter
Hi everyone,   Is there any counter function in R for the following purpose: x <- matrix(c(1,1,0,2,1,0,0,2,0,1,2,1,2,1,0,1),nrow=4) As I would like to know how many zeros, ones, and twos in each row of x?   Many thank in advance, Amor     [[alternative HTML version deleted]]
2015 Feb 05
7
[LLVMdev] i1 Values
I've been debugging some strange happenings over here and I put an assert in APInt to catch what I think is the source of the problem: int64_t getSExtValue() const { // An i1 -1 is unrepresentable. assert(BitWidth != 1 && "Signed i1 value is not representable!"); To me an i1 -1 makes no sense whatsoever. It is not representable in twos-complement form. It cannot
2018 Sep 17
1
Re: [PATCH nbdkit v2] common: Introduce round up, down; and divide round up functions.
On 9/17/18 3:38 PM, Richard W.M. Jones wrote: > These are used at various places in the code already. This > refactoring simply moves them to a common header file and should have > no other effect. > --- > common/include/rounding.h | 59 +++++++++++++++++++++++++++++++++++++ > filters/cache/Makefile.am | 3 +- > filters/cache/cache.c | 2 +- >
2009 Nov 16
8
extracting the last row of each group in a data frame
Hi, I would like to extract the last row of each group in a data frame. The data frame is as follows Name Value A 1 A 2 A 3 B 4 B 8 C 2 D 3 I would like to get a data frame as Name Value A 3 B 8 C 2 D 3 Thank you for your suggestions in advance Jeff
2010 Apr 07
2
Creating two lines of best fit on a scatter plot
Hello I am trying to plot two lines of best fit on a scatter plot. I'm plotting number of visits (y) against personality (x), half the plots are blue for patchchoice one and the other plots are red for patchchoice two (these options come from one factor, see below) . So i need a line for the patch ones and another line for the patch twos. How would i go about doing this? I know i
2017 Aug 24
2
How do set 'nest' addribute in an indirect call?
On 08/24/2017 09:40 AM, Tim Northover wrote: > On 17 August 2017 at 15:15, Rodney M. Bates via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> For an indirect call, i.e., on a function whose address is runtime variable, >> I can't find any place/way to attach this attribute. LLVMAddAttribute >> won't take a type. > > In the C++ API you'd add the
2008 Aug 22
0
[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]
On Aug 22, 2008, at 9:34 AM, Chris Lattner wrote: > C has a way to express this: signed integers are defined to never > overflow, unsigned integers are defined to wrap gracefully on > overflow. And gcc has yet more fun in it: -fstrict-overflow Allow the compiler to assume strict signed overflow rules, depending on the language being compiled. For C
2013 Nov 25
2
[LLVMdev] How do downcast signed integers?
I was looking at "trunc" to downcast a signed integer, say sint32 to sint16, but it seems to handle unsigned integers only. How do you downcast a signed integer? P.S. This question is for my "Mapping High-Level Constructs to LLVM IR" document :-) -- Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 May 26
2
question about coding
John Miles wrote: > You'll definitely have to encode in little-endian form. PCM audio is always > little-endian, to the best of my knowledge. I have never seen any > big-endian audio data files. Try AIFF, AU and IFF just for starters. They are definietly not the only ones. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo
2011 Feb 14
2
Is there a way to force counters to be treated as "unsigned?"
I am acquiring some sampled data that is time-stamped (with a POSIXct). Some of the data is in the form of "counters" -- that is, what is interesting isn't value of a given counter at a given time, but the change in the counter from one sample to a later one. As the counters are only incremented, they would be perceived to be monotonically increasing -- ideally. Unfortunately, the
2008 Aug 22
5
[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]
On Aug 22, 2008, at 9:30 AM, Vikram S. Adve wrote: > In the general case, I think you have to be conservative about this > because programmers may deliberately want this kind of "wraparound" > behavior, e.g., with periodic boundary conditions. But 99.9% of > programs probably don't need that so it would be bad to penalize them > for this corner case. In such a
2016 Feb 27
4
[isocpp-parallel] Proposal for new memory_order_consume definition
On Thu, Feb 25, 2016 at 04:46:50PM -0800, Hans Boehm wrote: > If carries_dependency affects semantics, then it should not be an attribute. I am not picky about the form of the marking. > The original design, or at least my understanding of it, was that it not > have semantics; it was only a suggestion to the compiler that it should > preserve dependencies instead of inserting a fence
2012 Aug 05
1
trouble with looping for effect of sampling interval increase
I've looked everywhere and tinkered for three days now, so I figure asking might be good. So here's a general rundown of what I am trying to get my code to do I am giving you the whole rundown because I need a solution that retain certain ways of doing things because they give me the information i need. I want to examine the effect of increasing my sampling interval on my data. Example:
2013 Nov 25
0
[LLVMdev] How do downcast signed integers?
Hello > I was looking at "trunc" to downcast a signed integer, say sint32 to sint16, > but it seems to handle unsigned integers only. No. In twos-complement notation (which LLVM assumes) there no difference between signed and unsigned truncation - you just throw out the spare sign bits and that's all. Please note that that the "numbers" in LLVM IR is neither signed
2008 Feb 21
1
Permutation Test
Dear R users, i am fairly new to R and am having trouble creating code to solve a problem. I've searched the list, combed Crawley's 'R book' and several others, but can't quite find what i want. I want to generate permutations of various 'blocks' of 14 numbers. Each number within a block is a character state for a particular biological taxon. In the example below, for
2016 Feb 27
0
[isocpp-parallel] Proposal for new memory_order_consume definition
On Feb 27, 2016 09:06, "Paul E. McKenney" <paulmck at linux.vnet.ibm.com> wrote: > > > But we do already have something very similar with signed integer > overflow. If the compiler can see a way to generate faster code that > does not handle the overflow case, then the semantics suddenly change > from twos-complement arithmetic to something very strange. The
2003 Feb 25
1
summary(polr.object)
Dear all, I have used polr in MASS but I am uncertain about the summary(polr.object) interpretation and would be happy for help on that. This is my summary: > summary(shade.polr) Re-fitting to get Hessian Call: polr(formula = as.ordered(shade) ~ as.factor(objekt), data = sof, weights = as.numeric(frek)) Coefficients: Value Std. Error t value 2.1699520 0.3681840 5.8936612