similar to: apply and sort vs vectorized order

Displaying 20 results from an estimated 10000 matches similar to: "apply and sort vs vectorized order"

2012 Jul 17
2
order or sort doesn´t work properly
Hi all, I want to order a series that is included on the second column in MCT.csv. I do but R doesn?t order, could be because is a csv? I have prove MCT<-read.csv("MCT.csv") a<-order(MCTor[,2],2,decreasing = FALSE) a<-order(MCTor[,2],1,decreasing = FALSE) or the same with sort but didn?t worked. It is suposed that a will have the ordered on ascending or descending
2011 Apr 04
0
Inconsistency: sort(NULL)/sort.int(NULL) does not throw an error, cf. order(NULL), sort.int(NULL, index.return=TRUE), ...
Hi, while backtracking why sort(NULL) gives a warning, and acknowledging that NULL is not the same as an empty vector and sort(NULL) is bad coding, I discovered the following inconsistency of sort.int(): > x <- NULL > sort(x) Warning in is.na(x) : is.na() applied to non-(list or vector) of type 'NULL' NULL > sort.int(x) Warning in is.na(x) : is.na() applied to non-(list
2020 Jan 13
0
Error in R CMD check --as-cran ?
I've been fighting a CMD check error for coxme this morning.?? I thought I had it fixed, but instead I had forgotton --as-cran on my last test run.? So the version just submitted to CRAN has warning messages in the log. I think it is an issue with CRAN.?? I've sent a message to R-devel asking for help.?? Since then, as a guess, I renamed my internal "ismat" function to
2003 Nov 07
2
Non-standard axis plotting
I am trying to plot positions on a grid where the x and y axis equate to longitudinal and latitudinal co-prdinates respectively. As these co-ordinates are southings and westings, i need the origin of my graph to contain the two highest values of each co0ordinate, with the values decreasing in both respects along both axes - I cannot seem to find any function within r to allow me to do this. Also,
2019 Dec 13
0
Question regarding Ogg’s multiplexing process
Hi, I have a question regarding Ogg’s multiplexing process. Let’s say we have two logical streams, S1 and S2, which need to be muxed together into one physical stream. On logical stream S1, we have a packet that’s too big and needs to be split into two pages, P1 and P2. On the other hand, logical stream S2 also has a page Px that needs to go out. When these 2 logical streams are muxed together,
2008 Aug 21
1
order(x,y, decreasing = c(FALSE, TRUE)) - how / elegantly?
I've found the need to compute a version of order(x,y) where I want the sort order for *increasing* x and *decresing* y ... something we could imagine could be provided in the future as order(x,y, decreasing = c(FALSE, TRUE)) i.e., using a 'vectorized' decreasing argument. {No, I'm not volunteering right now!} I've found the following R-level solution and like to quiz
2005 Nov 08
0
sorting during xtabs? sorting by "individual" order?
Hey alltogether, refacturing a package (before it will be released), I ran across the following problem. I have two directories with different text files, I want to read the first and construct a document-term matrix from it (every term=word in a row, every file in a column, occurrence frequencies form the values). The second directory contains different files. It needs to be read in to also
2002 Sep 03
0
FIX for old and new problems with order(): order fails with na.last=NA (PR#1981)
I recently reported order() to ignore decreasing=TRUE with na.last=NA. Now I discovered two other problems and send corrected code. Best regards Jens Oehlschlägel # PROBLEM 1 see PR#1906 # PROBLEM 2 > order(1, na.last=NA) Error in apply(sapply(z, is.na), 1, any) : dim(X) must have a positive length # clearly wrong as > order(1) [1] 1 # is defined # PROBLEM 3 >
2012 May 31
1
density plots using density.lf, data.frame and sort.int errors
Dear R help group: I am attempting to produce a density plot from a list of 20000 values using the density.lf function and would appreciate any help, I hope I have done my homework reading the documentation but I still seem to be missing something basic. I have read the data as a table using read.table, with header=TRUE (I excluded 2000 values), when calling the objects it appears to be there and
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
2020 May 08
0
base::order making available retGrp and sortStr options for radix method?
Hi together, a bit more than a month ago I have released the 'collapse' package for advanced and fast data transformation in R with an array of fast grouped and weighted functions and facilities for efficient grouped programming in R. As I am preparing the next update of this package I have come across the following: For grouping, 'collapse' uses the function 'GRP', and
2012 May 09
1
How to apply functions across columns?
Hello, me again. I have a data frame that looks like this (actual dput output at bottom): > head(tencor) date lot wf.id s1 s2 s3 s4 s5 1 08.05.2012 W0X3H0 9 1238 1263 1244 1200 1183 2 08.05.2012 W0X3H0 10 1367 1396 1371 1325 1311 3 08.05.2012 W0X3H0 11 1383 1417 1393 1346 1328 I'd like to add a column to this that gives, for each row, the averages of the
2011 Oct 04
1
a question about sort and BH
Hi, I have two questions want to ask. 1. If I have a matrix like this, and I want to figure out the rows whose value in the 3rd column are less than 0.05. How can I do it with R. hsa-let-7a--MBTD1 0.528239197 2.41E-05 hsa-let-7a--APOBEC1 0.507869409 5.51E-05 hsa-let-7a--PAPOLA 0.470451884 0.000221774 hsa-let-7a--NF2 0.469280186 0.000231065 hsa-let-7a--SLC17A5
2006 Jul 28
1
order() 'decreasing =' argument must be typed in full
## While in R v. 2.3.1 (the mid-July patch for Windows) ## on a Windows XP machine, this call to order() works fine... order(1:10,decreasing = TRUE) ## [1] 10 9 8 7 6 5 4 3 2 1 ## ...however, the argument name 'decreasing' ## must be typed in toto (note the missing 'g' ## in the following): > order(1:10,decreasin = TRUE) ## Error in order(na.last, decreasing, ...) :
2013 Nov 17
1
order() function, decreasing=TRUE unexpected behaviour
There appears to be an issue with the decreasing=TRUE option on the order() function that indicates either a bug or perhaps a design flaw (potentially flawed because I would suggest the majority of users would expect different behaviour). # demonstration of problem: x <- c(2,1,3,4,5) order(x) order(x, decreasing=TRUE) order(x) correctly reports the order as: 2 1 3 4 5 I expected the result
2008 Nov 11
1
Question about Sort
Hi, I am wondering if there is an option to control how R sort characters on different machines. For example, on my Mac OS X > sort(c("H", "a"), decreasing = TRUE) [1] "a" "H" The same command on a Linux machine gives me > sort(c("H", "a"), decreasing = TRUE) [1] "H" "a" I don't know if there is an
2009 Jun 24
1
order by decerasing 1st variable and increasing 2nd variable
Hello, I have a data.frame which I would like to sort with the primary key decreasing while the secondry key is increasing e.g. x <- data.frame(One=c(1,1,1,2,2,3,4,5),Two=c(2,3,1,2,3,3,3,3)) I would like to order it so it looks like this: One Two 8 5 3 7 4 3 6 3 3 4 2 2 5 2 3 3 1 1 1 1 2 2 1 3 i.e. primarily decreasing in the 1st column but if there is a
2007 Aug 06
1
rank in decreasing order
Hi All, I want to give ranks to elements in a column so I used: total_list$field1.rank <- rank(total_list$field1,ties.method="min") But this gives me the rank in increasing order. How do I get the ranks in decreasing order? I know decreasing = FALSE is not a legal argument here. Thanks. Jiong The email message (and any attachments) is for the sole use of the intended recipient(s)
2006 Oct 26
1
applying order() in a for loop
Hi, with the code below I try to organize sections of a data.frame. The dataframe has 9 data columns. I'd like to order the columns of the data.frame by the sum of the columns' entries. The sections of the columns are identified by "i". The order of the columns is given by the vector "z". Each section of the data.frame is ordered differently. This can be seen when
2018 Apr 06
2
Part of fastpass in 'sort.list' can make sorting unstable
In the code of functions 'order' and 'sort.list' in R 3.5.0 alpha (in https://svn.r-project.org/R/branches/R-3-5-branch/src/library/base/R/sort.R), in "fastpass, take advantage of ALTREP metadata", there is "try the reverse since that's easy too...". If it succeeds, ties are reordered, violating stability of sorting. Example: x <- sort(c(1, 1, 3)) x # 1