similar to: sort question in a dataset?

Displaying 20 results from an estimated 9000 matches similar to: "sort question in a dataset?"

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
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
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
2005 Jun 29
2
Sort by docid
Hello, I wonder if there is a way to cause Xapian to order a result set purely by docid. In other words, once the result set has been determined, I'd like the results to be returned to me ordered by their docid, as opposed to by their match relevance. The problem at hand is that I'm building a search engine for a mailing list and I would like to return matches sorted by date; ordering by
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
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
2013 Oct 02
2
unknown message 0:0 [sender]
hi all, running a transfer from a rsync client (3.0.6) to a rsync server (3.1.0), I get the following message: $ RSYNC_PASSWORD="oooo" rsync -avn --delete /xx/yy/ rsync:// aaa at bbb.com/ccc/ddd/ <<motd displayed>> sending incremental file list unknown message 0:0 [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(436) [sender=3.0.6] Server logs
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
2005 Nov 22
3
graphing help
Hello all, Does anyone know how to make R graph the x-axis in descending order? I am all set in creating a vertical bar chart using either the plot or the xychart (in lattice), but I need the x-axis in descending order. I have tried resorting the data but apparently R automatically graphs the x-axis in ascending order. I have multiplied the data used for the x-axis by -1 and this works but now
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
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
2005 May 13
1
manipulating dataframe according to the values of some columns
hi netters, I'm a newbie to R and there are some very simple problems puzzeled me for two days. I've a dataframe here with several columns different in modes. Two of the columns are special for me: column 1 has the mode "factor" and column 2 has the mode "numeric vectors". The values for column 1 are either "T" or "F". I wanna do two things:
2001 Jan 12
1
sorting ascending descending! & THX@coling
THX. You are right!! a[order(-1*a)] [1] 110 23 4 3 2 Eryk coling wrote: > Hi, > > I know very little of R, but one suggestion could be to multiply your list > by "-1", then order, then multiply by "-1" again. > > Not very nice I realize. But it's "better than a poke in the eye with a > sharp stick" as a wise man once
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
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
2009 May 27
3
Sort matrix by column 1 ascending then by column 2 decending
I've got a matrix with 2 columns and n rows. I need to sort it first by the values in column 1 ascending. Then for values which are the same in column 1, sort by column 2 decending. For example: 2 .5 1 .3 1 .5 3 .2 Goes to: 1 .5 1 .3 2 .5 3 .2 This is easy to do in spreadsheet programs but I can't seem to work out how to do it in R and haven't been able to find a solution anywhere.
2011 Mar 08
1
How to sort using a predefined criterion
Dear R helpers, Suppose I have following data.frame. df <- data.frame(category = c("treat_A", "treat_A", "treat_A", "treat_A", "treat_A", "treat_A", "treat_A", "treat_A", "treat_B", "treat_B", "treat_B", "treat_B", "treat_B", "treat_B",
2007 Sep 07
2
R first.id last.id function error
Hi R users, I have a test dataframe ("file1," shown below) for which I am trying to create a flag for the first and last ID record (equivalent to SAS first.id and last.id variables. Dump of file1: > file1 id rx week dv1 1 1 1 1 1 2 1 1 2 1 3 1 1 3 2 4 2 1 1 3 5 2 1 2 4 6 2 1 3 1 7 3 1 1 2 8 3 1 2 3 9 3 1 3
2008 Mar 24
1
Great difference for piecewise linear function between R and SAS
Dear Rusers, I am now using R and SAS to fit the piecewise linear functions, and what surprised me is that they have a great differrent result. See below. #R code--Knots for distance are 16.13 and 24, respectively, and Knots for y are -0.4357 and -0.3202 m.glm<-glm(mark~x+poly(elevation,2)+bs(distance,degree=1,knots=c(16.13,24)) +bs(y,degree=1,knots=c(-0.4357,-0.3202
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]]