similar to: order(x,y, decreasing = c(FALSE, TRUE)) - how / elegantly?

Displaying 20 results from an estimated 6000 matches similar to: "order(x,y, decreasing = c(FALSE, TRUE)) - how / elegantly?"

2006 May 14
1
Dragable element
Hey all Im having a problem... Ok, this is the situation... I have a small product image, on which ive floated a div over it, and defined it as draggable. Now, this works, and i can drag it around no problem. great. but then, what i want to do is, based on the location of that dragable element from the top and the left, to move (using the Effect.MoveBy method) a larger image - so effective
2012 Oct 20
2
Help with programming a tricky algorithm
Hi All, I'm a little stumped by the following problem. I've got a dataset with the following structure: idxy ix iy country (other variables) 1 1 1 c1 x1 2 1 2 c1 x2 3 1 3 c1 x3 . . . . . 3739 55 67 c7 x3739 3740 55 68 c7 x3740 where ix and
2009 Jun 05
1
Antialiasing plots and text on different devices
I have a question about antialiasing when R generates bitmaps. (This follows a thread on the ggplot2 mailing list.) I mostly use R on Linux, although I sometimes use it in Mac and Windows as well. On Linux, I've found that plotting shapes 15-18 via cairo results in bad-looking output. The points are not antialiased, and they are jagged and misshapen. Plots generated in Windows also aren't
2018 Jul 25
2
Question about target instruction optimization
Yes, such optimizations are something for the "last 20%" of the project, nice to have's. As of now, I have yet to get a feeling of what LLVM can do on its own, depending on what it's from the instruction tables and where it needs help, and how much in other processing stages. As this affects the way how the instruction info table will be set-up, I appreciate your suggestions
2019 Aug 15
4
[LLVM] (RFC) Addition/Support of new Vectorization Pragmas in LLVM
The ivdep pragma is designed to do exactly what the name states - ignore vector dependencies.  Cray Research first implemented this in 1978 in their CFT compiler, and has supported it since. This pragma is typically used by application developers who want vectorized code when the compiler cannot automatically determine safety; it is not equivalent to the OpenMP SIMD pragma in that the compiler is
1997 Jul 14
1
R-beta: Plotting: numeric 'col' colors; col=0, col=1, .. | Nice "funclet"
``We all know'' that R has more flexible and nicer color specifications than S-plus. There are situations however, where I'd like to specify colors numerically, e.g. 1) convenience of using different colors in a for(.) loop or 2) backward compatibility with S. In S, there's the quite known ``standard'' col = 0 :<==> current background color [ = white by
2011 Apr 06
3
function order
Dear All I'm trying to sort a matrix using function order, Some thing really odd: e.g. abc<-cbind(c(1,6,2),c(2,5,3),c(3,2,1))## matrix I want to sort if I do abc[ order(abc[,3]), increasing = TRUE] the result is correct [,1] [,2] [,3] [1,] 2 3 1 [2,] 6 5 2 [3,] 1 2 3 But if I want to sort in decresing order: abc[ order(abc[,3]), decreasing = TRUE] the
2011 Dec 16
0
crash in using Rcpp and inline packages.
Hi all, I am using c++ functions in R by Rcpp and inline packages. The code is quite simple, but the R session always automatically crash after some running time. Does anyone here familiar with Rcpp and inline? What¡¯s the problem in the following code? I have checked the input values, no NA and other strange value exists. Thank you for your attention! > mkc <- cxxfunction(
2011 Dec 16
0
Fw: crash in using Rcpp and inline packages.
Hi all, I am using c++ functions in R by Rcpp and inline packages. The code is quite simple, but the R session always automatically crash after some running time. Does anyone here familiar with Rcpp and inline? What¡¯s the problem in the following code? I have checked the input values, no NA and other strange value exists. Thank you for your attention! > mkc <- cxxfunction(
2006 Apr 11
1
gaussian family change suggestion
Hi, Currently the `gaussian' family's initialization code signals an error if any response data are zero or negative and a log link is used. Given that zero or negative response data are perfectly legitimate under the GLM fitted using `gaussian("log")', this seems a bit unsatisfactory. Might it be worth changing it? The current offending code from `gaussian' is:
2007 Nov 28
1
ifelse function
Hi there, I need help with IFELSE function. The column g of my dataset pth, pth$g consists of "aa", "ao", "dcl", "iy", "sh". The last few values of pth$g looks like: [4496] sh ao ao sh iy dcl dcl aa iy iy aa sh ao ao Levels: aa ao dcl iy sh I want to convert these values into 1,2,3,4,5. I tried to use a loop and I found the following
2019 Mar 25
2
Overlapping register groups in old 8-bit MC6809 processor.
Hi I'm returning to my MC6809 back-end from a health-related hiatus. The assembler is tantalisingly close, but I've got some parsing and matching problems. The register set; these overlap in annoying ways, for instance, two instructions TFR and EXG each have a single opcode, and the post-byte specifies which registers are to be involved, but the registers can be 8- or 16-bit, and 2 of
2012 Mar 10
1
applying a function in list of indexed elements of a vector:
Hi, I have a vector Y1 <-c(8, 11, 7, 5, 6, 3, 6, 3, 3) and an index iy <-c(c(1, 2),c(1 2), c(1, 2, 3, 4), c(2, 3, 5), c(4), c(5, 6, 7), c(7, 8, 9)) how can I produce the mean, or the sum of the elements specified in the index iy from the vector Y1? expecting something like this for the sum: Y2 19 19 31 24 5 15 12 I thought lapply function may perform this, but does not work:
2009 Mar 14
4
persp plot + plotting grid lines
Dear all; Does anyone know how to add grid lines to a persp plot? I've tried using lines(trans3d..) but the lines of course are superimposed into the actual 3d surface and what I need is something like the plot shown in the following link: http://thermal.gg.utah.edu/tutorials/matlab/matlab_tutorial.html I'll appreciate any ideas Thanks PM
2018 Jul 21
2
Finding scratch register after function call
For a Z80 backend, "eliminateCallFramePseudoInstr()" shall adjust the stack pointer in three possible ways, e.g. after a function call, depending on the amount (= adjustment size) *and some other rules*: 1. via one or more target "pop <reg>" instructions (SP increments +2 per instruction), using an unused reg (disregarding the contents after the operation), followed
2005 Jan 03
2
Memory Efficient Methods for Building Matrix
Dear List: I am having to build a block-diagonal matrix (vl) and am currently using the following code. I<-diag(sample.size) vl<-kronecker(I,vl.mat) This code works fine, but for large N, it is a huge memory hog. Is there a more efficient method for constructing vl? Thanks, Harold [[alternative HTML version deleted]]
2012 Jan 30
2
Euler identity with complex exp
Hi, Am i doing something silly here in expecting Euler's formula to be handled by exp? exp( ix ) = cos x + i sin x. The first example below follows this, the others not. Thanks for the education! > exp( complex(real = 0, imag = 2*pi) ) [1] 1-0i > exp( complex(real = pi, imag = 2*pi) ) [1] 23.14069-0i > exp( complex(real = pi/2, imag = 0) ) [1] 4.810477+0i [[alternative HTML
2018 Dec 04
0
order(decreasing=c(TRUE,FALSE),...)
The NEWS file for R-devel (as of 2018-11-28 r75702) says ? order(...., decreasing=c(TRUE,FALSE)) could fail in some cases. Reported from StackOverflow via Karl Nordstr?m. However, either I don't understand the meaning of decreasing=c(TRUE,FALSE) or there are still problems. I thought order(x,y,decreasing=c(TRUE,FALSE) meant to return indices, i, such that x[i] was non-increasing and
2018 Jul 25
2
Question about target instruction optimization
This is a question about optimizing the code generation in a (new) Z80 backend: The CPU has a couple of 8 bit physical registers, e.g. H, L, D and E, which are overlaid in 16 bit register pairs named HL and DE. It has also a native instruction to load a 16 bit immediate value into a 16 bit register pair (HL or DE), e.g.: LD HL,<imm16> Now when having a sequence of loading two 16
2007 Mar 31
3
strange fisher.test result
A simple question - using the following fishers test it appears that the P value is significant, but the CI includes 1. Is this result correct? > data.50p10min <- matrix(c(16,15, 8, 24),nrow=2) > fisher.test(data.50p10min) Fisher's Exact Test for Count Data data: data.50p10min p-value = 0.03941 alternative hypothesis: true odds ratio is not equal to 1 95