Displaying 20 results from an estimated 6000 matches similar to: "Wanted: sort.data.frame"
2004 Sep 24
0
Function sort.data.frame
I can never remember how to use "order" to sort the rows of a data frame,
so like any good, lazy programmer, I decided to write my own function.
The idea is to specify a data.frame and a one-sided formula with +/-
indicating ascending/descending. For example:
sort.data.frame(~ +nitro -Variety, Oats)
Since sorting of a data.frame is an oft-asked question on this list, I am
posting
2005 Jul 08
1
Suggestion: Help users sort data frames
I've noticed that a frequently asked question on R-help is how to sort a
data frame by multiple columns. Since this question is asked so often,
making this task easier for users seems a worthwhile goal.
At a minimum, the following changes to the documentation would surely be
helpful and reduce email postings to R-help:
1. In the "See Also" section of the help page for
2006 Oct 15
3
sort question in a dataset?
Dear friends,
I want to sort a dataset according to one or two variables in the dataset,
i thought sort could do it , but failed.
e.g.
x <- c(2, 9, 18, 3, 2)
y<-c(2,5.6,5,9,8)
z<-c(21,5,5,19,7)
a<-cbind(x,y,z)
a
x y z
[1,] 2 2.0 21
[2,] 9 5.6 5
[3,] 18 5.0 5
[4,] 3 9.0 19
[5,] 2 8.0 7
I want to sort dataset a according to ascending x and descending y, How to
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
2004 May 17
1
basics: how do you sort a table?
Hi,
This may be a very basic question but it seems i cannot figure it
out does not matter what.
how do you sort a table (ascending or descending) after the values
in one particular column? I want to do something like the sort
function in Xcel.
Also, is there any other plot function that accepts log for y axes
like the parplot2() from gregmisc? Thanks for the tip Marc about
barplot2. very
2002 May 06
3
function sort.list()
Derar R-people
I have troubles understanding what the function sort.list() is doing. On
the homepage it says that it returns a permutation which rearranges a
vector into ascending or descending order (like order() but on a vector
instead of a sequence).
> sort.list(c(0, 2, 10, 11, 4))
[1] 1 2 5 3 4
which does not make sense to me.
In fact I am getting the same (non-sensical) result using
2009 Feb 09
0
FXIconList sort function
On Feb 3, 2009, at 5:26 PM, Jonathan Hadders wrote:
> I''m trying to implement an FXIconList with multiple columns so that
> the list can be sorted in ascending or descending order based on any
> of the columns (much like FXFileList, I believe). I ran across an
> earlier post of yours (8/5/2003 - http://www.varioustopics.com/ruby/189237-fxiconlist-questions.html)
>
2011 Jan 11
1
sorting question
Hi,
I have a data frame with variables a, b, c (character vars) and t (time var,
could be represented as POSIXct or character, depending on which is most useful.
The format is "yyyy-mm-dd hh:mm:ss CET"). Now, I want to sort the data frame in
ascending order by a, b, c and then in descending order by t.
Here's what I've got, but I'm not sure how to put the
2002 Mar 29
2
order()
Hi,
In the order() help file, there is an example like:
a <- c(4, 3, 2, NA, 1)
b <- c(4, NA, 2, 7, 1)
z <- cbind(a, b)
(o <- order(a, b)); z[o, ]
How can I do something like "order a in ascending order, b in descending
order"? And say I have a third vector c, and I'd like to add this to the
previous condition "a ascending, b descending, c
2003 Sep 11
2
Sorting
What is the best way to sort a dataframe?
For example, how would I go about sorting a dataframe (with variables V1-V5)
by ascending V1, V2 and descending V3 while retaining V4 and V5.
Also, is there a relatively easy way by which to re-order my columns?
Thank you for your time.
Marc
Marc Zodet
[[alternative HTML version deleted]]
2005 Oct 22
1
Sorting Numeric and Character Data
Hello,
I have what seems like an easy question to answer, but I'm struggling
with it.
I have a set of categorical data that I am reading in, looking
something like:
"category" "result"
"A" .234
"B" .123
"C" .564
"D" -.452
"E" .112
"F" -.106
I'd like to plot this twice on two separate dot charts, once
2007 Nov 18
1
how to sort a data.frame by ascending some columns
Dear list,
I have a data frame (238304 rows and 6 columns). I want the data frame
sorted by two columns in ascending order. I am showing
the first 5 rows of the data frame
> clones.info[1:5,1:6]
USER_CLONE_ID CHROMOSOME Expr1002 KB_POSITION Allele_A WELL_ID
1 SNP_A-1855402 17 41419603 41419603 C rs17572851
2 SNP_A-4249904 17 41420045 41420045 A rs17572893
3 SNP_A-2174835 18 41407760
2011 Aug 11
3
Fwd: Re: what is the fastest way to fetch results which are sorted by timestamp ?
(Forwarded off-list message)
-------- Original Message --------
Subject: Re: [Xapian-discuss] what is the fastest way to fetch results
which are sorted by timestamp ?
Date: Thu, 11 Aug 2011 01:06:36 +0800
From: ??? <panjunyong at gmail.com>
To: Tim Brody <tdb2 at ecs.soton.ac.uk>
On Wed, Aug 10, 2011 at 6:39 PM, Tim Brody <tdb2 at ecs.soton.ac.uk> wrote:
> Hi,
>
> In
2010 Jun 10
2
adding column of ordered numbers to matrix
Hello everyone,
I have a matrix of over 40000 line and about 30 columns.
For my analysis I would like to add another column with ascending numbers
(column header should be "order", and than 1,2,3,4 ....the end of the
matrix).
During my analysis I reorder them ( due to merge commands by a different
column).
How do I add such a column in an ascending order (or descending for what it
2013 Apr 24
2
Sum up column values according to row id
Dear All,
here a problem I think many of you can solve in few minutes.
I have a dataframe which contains values of plot id, diameters, heigths and
basal area of trees, thus columns names are: id | dbh | h | g
head(ipso, n=10) id dbh h g
1 FPE0164 36 13.62 0.10178760
2 FPE0164 31 12.70 0.07547676
21 FPE1127 57 18.85 0.25517586
13 FPE1127 39 15.54 0.11945906
12 FPE1127
2010 Aug 26
3
Non-standard sorts on vectors
I have a dataset I need to sort:
test.df<-data.frame(Zone=c("Floodplain", "Lake",
"Shoreline"),Cover=c(50,60,70))
However, I don't want it sorted ascending/descending but in an order that I
define via a vector:
sort.v<-data.frame(c("Lake","Shoreline","Floodplain"))
I realize I could probably just create the vector of
2000 Dec 14
1
Sort in descending order
Hi R users:
I want to know how can I easily sort in descending order a
whole data frame by one or several variables.
Thank you very much for your help.
Kenneth Cabrera
krcabrer at perseus.unalmed.edu.co
krcabrer at epm.net.co
Universidad Nacional de Colombia, Sede Medell?n
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2004 Oct 07
3
How to use alpha transparency channel for colors?
The release notes for R 2.0.0 states:
It is now possible to specify colours with a full alpha
transparency channel via the new 'alpha' argument to the
rgb() and hsv() functions, or as a string of the form "#RRGGBBAA".
NOTE: most devices draw nothing if a colour is not opaque,
but PDF and Quartz devices will render semitransparent colours.
A new argument
2009 Jan 23
2
Plot, lines and disordered x and y
Hello,
I have 2d data where x coordinate is not given in usual ascending
order (x1,...,x1+l; l>0), and instead in another, regular, but not
ascending or descending order (for illustration:
x1,-x1,x1+dx1,-x1-dx1,....).y is an array which corresponds to the way
x is ordered. I have noticed that giving 'plot(x,y,type='l') produces
a plot where the points are connected in a completely
2009 Feb 08
0
Modifying forestplot function in rmeta
All,
I am using the forestplot function in rmeta.
I was able to modify the x axis range by commenting out one line and
feeding it two new parameters (I wanted to set zero as the axis start point).
#xrange <- c(max(min(lower, na.rm = TRUE), clip[1]),
min(max(upper, na.rm = TRUE), clip[2]))
#new line
xrange <- c(xlow,xhigh)
Now I am trying to modify the text font size for