The result does NOT depend on whether or how the data itself are sorted, but
rather on how the levels of the factors in the data are sorted. Best results
will be obtained if you modify the data frame factors before giving the data
frame to ggplot. Doing so will allow all of the ggplot functions
Understood. Will review the docs again.
My data is from an external source which, among other things, ensures that it's
sorted correctly. I was asking for a way to have ggplot use the ordering in
place, instead of re-ordering everything. Apologies if it wasn't clear from the
original post.
A
On Wed, 15 Aug 2018 07:21:55 -0700
Stats Student wrote:
> Hi, I am generating multiple charts with facet_wrap() and what what I
> see, R/ggplot sorts the panels by the facet variable. So adding an
> index to the facet variable (1 - bucket, 2 - bucket, etc) does solve
> the sorting issue but it's
1. Unless there is good reason to keep a reply private, always cc the list.
This allows more brains, possible corrections, etc.
2. Have you read ?factor and ?unique ? Always study the docs carefully.
They are generally terse but complete, especially the base docs, and you
can often find your answe
See ?factor.
You can either use ?ordered to create an ordered factor to sort the levels
as you desire or sort them with factor(). e.g.
> f <- factor(letters[3:1])
> f
[1] c b a
Levels: a b c ## default ordering
> f <- factor(f, levels = letters[3:1])
> f
[1] c b a
Levels: c b a ## explicit or
Hi, I am generating multiple charts with facet_wrap() and what what I see,
R/ggplot sorts the panels by the facet variable. So adding an index to the
facet variable (1 - bucket, 2 - bucket, etc) does solve the sorting issue but
it's ugly.
I also read this post which, if I understand correctly,
tarting my PhD I feel
like I want something more "integrated"
Thanks,
Mario
From: Mark Sharp [msh...@txbiomed.org]
Sent: Friday, December 04, 2015 5:25 PM
To: BARLAS Marios 247554
Cc: r-help@r-project.org
Subject: Re: [R] Ordering Filenames stor
Mario,
I am certain there are more elegant solutions. This is an effort to make the
process clear by dividing out each transformation used into separate lines.
## Start of code
library(stringi) # This is written in C and C++ (ICU library), is fast, and is
well documented.
filenames <- c("Q_Read
> filenames <- c("Q_Read_prist#1...@1.xls", "Q_Read_prist#1...@10.xls",
> "Q_Read_prist#1...@2.xls")
> filenames <- gtools::mixedsort(filenames, numeric.type="decimal")
> filenames
[1] "Q_Read_prist#1...@1.xls" "Q_Read_prist#1...@2.xls"
"Q_Read_prist#1...@10.xls"
/Henrik
On Fri, Dec 4, 2015 a
The thread below has a number of solutions. I personally like the one with
sprintf().
https://stat.ethz.ch/pipermail/r-help/2010-July/246059.html
B.
On Dec 4, 2015, at 5:51 AM, BARLAS Marios 247554 wrote:
> Hello everyone,
>
> I am an R rookie and I'm learning as I program.
>
> I am work
Hello everyone,
I am an R rookie and I'm learning as I program.
I am working on a script to process a large amount of data: I read a pattern of
filenames in the folder I want and import their data
filenames = list.files(path, pattern="*Q_Read_prist*")
myfiles = lapply(filenames, function(x) re
Hi Jim,
I tried it and it while it does make the diagram look more like what I want,
there are a few categories still out of order. Thank you for your help!
-Angela
On Thu, 7/23/15, Jim Lemon wrote:
Subject: Re: [R] Ordering in Sankey diagram
Hi Angela,
Assuming that your reformatted data is named "data", have you tried:
data[order(data$count,data$before,decreasing=TRUE),]
Jim
On Thu, Jul 23, 2015 at 3:15 AM, Angela via R-help wrote:
> Hello,
>
> I am trying to figure out if there is a way to order the left side of a
> Sankey diagr
Hello,
I am trying to figure out if there is a way to order the left side of a Sankey
diagram from most frequent to least frequent. I am using R version 3.2.1 and
using googleVis version 0.5.9 for the Sankey. I've tried sorting, but that does
not work. Is there anyway to force it to arrange the
Dear Boris,
Thanks very much, have a great week.
Best regards
Antônio Olinto
Fisheries Institute
São Paulo, Brasil
2015-03-21 21:09 GMT-03:00 Boris Steipe :
> ... just for completeness - the more concise way: (no need to go through
> names()).
>
> boxplot(mydata[,order(apply(mydata,2,median)
... just for completeness - the more concise way: (no need to go through
names()).
boxplot(mydata[,order(apply(mydata,2,median))])
... or descending
boxplot(mydata[,order(-apply(mydata,2,median))])
B.
On Mar 21, 2015, at 7:04 PM, Boris Steipe wrote:
> There may be more concise ways to d
There may be more concise ways to do this - but you are 99% there with your
approach:
try:
boxplot(mydata[,names(sort(apply(mydata,2,median)))])
B.
On Mar 21, 2015, at 6:49 PM, Antonio Silva wrote:
> Thanks Bill and David
>
> Here goes an example
>
> SP1<-c(9,6,7,8,5,8,7,5,9,7)
> SP2<-c(1,
Thanks Bill and David
Here goes an example
SP1<-c(9,6,7,8,5,8,7,5,9,7)
SP2<-c(1,3,4,2,4,2,5,3,2,1)
SP3<-c(4,6,7,5,7,8,7,6,5,4)
SP4<-c(5,4,3,5,2,3,4,3,4,2)
mydata<-data.frame(SP1,SP2,SP3,SP4)
rownames(mydata)<-c("ST1","ST2","ST3","ST4","ST5","ST6","ST7","ST8","ST9","ST10")
mydata
boxplot(mydata)
You can use the reorder() function to reorder the grouping vector's
factor levels according to a function of the data in each group. E.g.,
compare the following two plots:
d <- data.frame(Response=cos(1:15), Group=rep(c("A","B","C"),c(6,5,4)))
par(mfrow=c(1,2))
boxplot(Response ~ Group,
On Mar 20, 2015, at 2:20 PM, Antonio Silva wrote:
> Hello
>
> I'm using a dataframe (mydata) where row names are sampling points and
> column names are species in a multivariate analysis.
>
> If I write boxplot(mydata) I'll have boxplots for each species abundance in
> alphabetical order.
>
>
Hello
I'm using a dataframe (mydata) where row names are sampling points and
column names are species in a multivariate analysis.
If I write boxplot(mydata) I'll have boxplots for each species abundance in
alphabetical order.
How to get the boxes orderer by the median?
Usually for this I write
Ah, ok, thank you for explanations!
Dmitry
On 03/01/2014 20:00, Bert Gunter wrote:
You misunderstand = I was not sufficiently clear.
What is false is your statement that "you **need** to attach the data
file before sorting." You do not. with()/within() can be used to avoid
using the fully qual
You misunderstand = I was not sufficiently clear.
What is false is your statement that "you **need** to attach the data
file before sorting." You do not. with()/within() can be used to avoid
using the fully qualified names without attaching. I did not claim
that attaching first would not work, onl
Bert, why do you think that "attach" is not working in this case? Did
you check it before your advice? :)
I agree about "generally bad approach", but it is quite convenient for
work with one data set.
Dmitry
On 03/01/2014 18:28, Bert Gunter wrote:
Inline
Bert Gunter
Genentech Nonclinical Bio
Inline
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Fri, Jan 3, 2014 at 7:08 AM, Dmitry Pavlyuk
wrote:
> Hi Sofia!
>
> You need to attach the data file before
Hi Sofia!
You need to attach the data file before sorting:
attach(df_final)
or just use full qualified names (like df_final$Y_init)
Dmitry
On 03/01/2014 16:41, Stefano Sofia wrote:
> Dear R users,
> I have two files of seasonal rainfall data (more than 10,000 rows each); here
> the first 8 ro
On Fri, Jan 3, 2014 at 9:41 AM, Stefano Sofia
wrote:
>
> Dear R users,
> I have two files of seasonal rainfall data (more than 10,000 rows each); here
> the first 8 rows of each file are reported.
>
> Code_Raingouge,Y_init,M_init,D_init,h_init,m_init,Y_fin,M_fin,D_fin,h_fin,m_fin,Rainfall,N_Value
Dear R users,
I have two files of seasonal rainfall data (more than 10,000 rows each); here
the first 8 rows of each file are reported.
Code_Raingouge,Y_init,M_init,D_init,h_init,m_init,Y_fin,M_fin,D_fin,h_fin,m_fin,Rainfall,N_Values,Quality_Level,Code_Station
2000,1952,12,1,0,0,1953,3,1,0,0,307
Hi Ramón,
It is for the column index.
For ex:
tags_totals[order(tags_totals[,1],decreasing=TRUE),1,drop=FALSE] #same as
previous solution as there is only one column.
# [,1]
#Grupos 23
#Wikis 15
#Glosarios 11
#Bases de datos 7
#Taller 5
Hi Ramón,
May be this helps:
tags_totals<-matrix(c(15,11,23,7,5),ncol=1,dimnames=list(c("Wikis","Glosarios","Grupos","Bases
de datos","Taller"),NULL))
tags_totals[order(tags_totals[,1],decreasing=TRUE),,drop=FALSE]
# [,1]
#Grupos 23
#Wikis 15
#Glosarios 1
.
[2,] 33.29079 115.2602
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of Pete Brecknock
> Sent: Sunday, March 24, 2013 5:12 PM
> To: r-help@r-p
or this with Pete's example
orig[,order(orig[2,])]
Pete Brecknock wrote
>
> fitz_ra wrote
>> I know this is posted a lot, I've been through about 40 messages reading
>> how to do this so let me apologize in advance because I can't get this
>> operation to work unlike the many examples shown.
fitz_ra wrote
> I know this is posted a lot, I've been through about 40 messages reading
> how to do this so let me apologize in advance because I can't get this
> operation to work unlike the many examples shown.
>
> I have a 2 row matrix
>> temp
>[,1] [,2] [,3] [,4] [,5]
cdouglass wrote
> Hello all,
>
> Totally new to this and I'm just doing a frequency distribution analysis
> on T-shirt sales by size. I have a .csv with 60 orders. I read in the
> data using read.csv. If I look at the summary() or table() of the data it
> looks fine, except that the shirt sizes
As long as all your names of list elements are in the same format,
this should do it:
mylist[order(names(mylist))]
Thanks for the reproducible example,
Sarah
On Tue, Nov 20, 2012 at 11:40 AM, Simon Kiss wrote:
> Dear colleagues,
> Is there a way to order list items by date? I have a series of
ovember 20, 2012 8:41 AM
> To: r-help@r-project.org
> Subject: [R] Ordering List Items Chronologically
>
> Dear colleagues,
> Is there a way to order list items by date? I have a series of surveys in a
> list where the
> name of each list item is the date the survey was ta
Dear colleagues,
Is there a way to order list items by date? I have a series of surveys in a
list where the name of each list item is the date the survey was taken but the
list items are out of order. Each data frame has a variable in it with the
survey date as well, if that helps.
Yours, Simon
On Feb 3, 2012, at 4:16 PM, Tulinsky, Thomas wrote:
I was surprised to find that just changing the base level of a
factor variable changed the number of significant coefficients in
the solution.
I was surprised at this and want to know how I should choose the
order of the factors, if the
I was surprised to find that just changing the base level of a factor variable
changed the number of significant coefficients in the solution.
I was surprised at this and want to know how I should choose the order of the
factors, if the order affects the result.
Here is the small example. It is
That worked great thank you.
--
View this message in context:
http://r.789695.n4.nabble.com/Ordering-of-stack-in-ggplot-package-ggplot2-tp3917159p3917520.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing lis
On Oct 18, 2011, at 7:59 PM, swonder03 wrote:
I'm trying to reproduce the 3rd graph on the page of this site:
http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ . However,
the data
below produces a ggplot with the stacks sorted in alphabetical order
from
the bottom up. I'd like the st
Hi:
levels(df.m2$Region)
[1] "Africa" "Americas" "Asia" "Europe" "Oceania"
Reorder your Region factor to the following:
df.m2$Region <- factor(df.m2$Region, levels = c('Europe', 'Asia',
'Americas', 'Africa', 'Oceania'))
Then recopy the code from the definitio
I'm trying to reproduce the 3rd graph on the page of this site:
http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ . However, the data
below produces a ggplot with the stacks sorted in alphabetical order from
the bottom up. I'd like the stacks to be in the order "Europe", "Asia",
"Americas, "
On Sep 10, 2011, at 4:03 PM, Luca Meyer wrote:
> Hi,
>
> I am running the following -masked- code:
>
> set.seed(23)
> city <- sample(c("C1","C2"),size=100,replace=T)
> reason <- sample(c("R1","R2","R3","R4"),size=100,replace=T)
> df <- data.frame(city,reason)
> library(gmodels)
> CrossTable(df$r
Hi,
I am running the following -masked- code:
set.seed(23)
city <- sample(c("C1","C2"),size=100,replace=T)
reason <- sample(c("R1","R2","R3","R4"),size=100,replace=T)
df <- data.frame(city,reason)
library(gmodels)
CrossTable(df$reason,df$city,prop.r=F,prop.c=F,prop.t=F,prop.chisq=F)
And I get th
r the gene name.
merge (smat, bmat, by= “gene”) # untested
Then apply the order command.
I hope I understood the problem this time
--- On Mon, 6/27/11, Aparna Sampath wrote:
> From: Aparna Sampath
> Subject: Re: [R] Ordering a matrix based on cluster no
> To: r-help@r-project.
Thanks for the help! But when I tried it, it does not work the same way I
want. :(
after combining the two matrices, they look like this:
V1V2 X TEL.AML1.C41
Hyperdip.50.C23
1 TEL.AML1.C41 1TEL.AML1.C41 1.000 0.
ot;,"c", "d", "e"),5))
df1 <- data.frame(smat, bmat)
orddata <- df1[order(df1[,2],decreasing=TRUE),]
I hope this helps.
--- On Sun, 6/26/11, Aparna Sampath wrote:
> From: Aparna Sampath
> Subject: [R] Ordering a matrix based on cluster no
> To: r
Hi All
I have a symmetric matrix of genes ( 100x100 matrix). I also have a matrix
(100x2) of two columns where column 1 has the gene names and column 2 has
the cluster it belongs to (they are sorted and grouped based on the cluster
no).
I would like to order the rows and columns of the 100x 100 m
I assume that this is what you did, and I would not call that
cheating; it is just a reasonable way to solve the problem:
> x <- as.matrix(read.table(textConnection(" 0.00 2.384158 2.0065682
> 2.2998856
+ 2.384158 0.00 1.4599928 2.4333213
+ 2.006568 1.459993 0.000 0.9733285
+ 2.299886
Sorry if this is a stupid question but I've been stuck on how to code
so that I can order rows of a matrix without paying attention to the
diagonal elements.
Say, for example, I have a matrix d:
d
[,1] [,2] [,3] [,4]
[1,] 0.00 2.384158 2.0065682 2.2998856
[2,] 2.3
Dear sir,
Thanks for the great solution.
Regards
Vincy
--- On Mon, 3/28/11, Henrique Dallazuanna wrote:
From: Henrique Dallazuanna
Subject: Re: [R] Ordering data.frame based on class
To: "Vincy Pyne"
Cc: r-help@r-project.org
Received: Monday, March 28, 2011, 9:02 PM
Try thi
Try this:
my_dat[order(my_dat$class, -my_dat$var1, decreasing = TRUE),]
On Mon, Mar 28, 2011 at 5:55 PM, Vincy Pyne wrote:
> Dear R helpers
>
> Suppose I have a data.frame as given below -
>
> my_dat = data.frame(class = c("XYZ", "XYZ", "XYZ", "XYZ", "XYZ","ABC", "ABC",
> "ABC", "ABC", "ABC" ),
Dear R helpers
Suppose I have a data.frame as given below -
my_dat = data.frame(class = c("XYZ", "XYZ", "XYZ", "XYZ", "XYZ","ABC", "ABC",
"ABC", "ABC", "ABC" ), var1 = c(20, 14, 89, 81, 17, 44, 36, 41, 11, 36), var2
= c(1001, 250, 456, 740, 380, 641, 111, 209, 830, 920))
> my_dat
class var
On 05.03.2011 18:40, djbirdnerd wrote:
not yet, but i have only just started programming in r...
I don't know if i will able to...
Without quoting the former thread and without replying to a particular
person (rather than the mailing list only): Do you expect anybody on the
mailing list kn
not yet, but i have only just started programming in r...
I don't know if i will able to...
--
View this message in context:
http://r.789695.n4.nabble.com/Ordering-several-histograms-tp382p3336869.html
Sent from the R help mailing list archive at Nabble.com.
_
Em 3/3/2011 12:00, djbirdnerd escreveu:
Hallo everyone,
I want to evaluate the change of the distribution for several size classes.
How can i order these separate histograms with the same y-axis along a
common x-axis according to their size classes. It would like it to look a
bit like this
(http
You could get close with the ggplot2 package using the function facet_grid or
facet_wrap, but each histogram would be on a separate x-axis
Scott
On Thursday, March 3, 2011 at 8:00 AM, djbirdnerd wrote:
> Hallo everyone,
>
> I want to evaluate the change of the distribution for several size clas
Hallo everyone,
I want to evaluate the change of the distribution for several size classes.
How can i order these separate histograms with the same y-axis along a
common x-axis according to their size classes. It would like it to look a
bit like this
(http://addictedtor.free.fr/graphiques/RGraphGa
On Sun, 2011-01-23 at 17:37 -0600, Stuart Luppescu wrote:
[snip] Thanks to Ben and Dennis for their help, but right after I sent
the original message, I figured out how to solve my problem. I noticed
that boxplot() contains the at= argument. To get the box locations, I
used a line like this:
box.l
Stuart Luppescu ccsr.uchicago.edu> writes:
>
> I want box plots by group to display in order of increasing
> mean (or median) of each group but can't seem to figure it out and
> couldn't find anything on R-seek, either.
>
?reorder ... ?
__
R-help
Hello all, I want box plots by group to display in order of increasing
mean (or median) of each group but can't seem to figure it out and
couldn't find anything on R-seek, either.
My data looks like this:
meas unit sid gradersprti
1 2.24 1002 9902NA 0.860
2 3.04 1007 43
I think you want the following, assuming you defined your function g():
gValues = apply(S, 1, g);
Sordered = S[order(gValues), ]
Peter
On Fri, Jan 21, 2011 at 11:38 AM, Francesco Petrogalli
wrote:
> Hi,
> is there a R function that order a matrix according to some criteria
> based on the rows(
look at 'order'
yourMatrix[order(yourMatrix[, 'yourCol']), ]
On Fri, Jan 21, 2011 at 2:38 PM, Francesco Petrogalli
wrote:
> Hi,
> is there a R function that order a matrix according to some criteria
> based on the rows(or cols) of that matrix?
>
> For example, let's say that my matrix S is compo
Hi,
is there a R function that order a matrix according to some criteria
based on the rows(or cols) of that matrix?
For example, let's say that my matrix S is composed by n rows S_1,
S_2,.., S_n and that I compute some real value g_i=g(S_i) for each
row.
Then I want to order this set of g_i (from
Here is a way of putting "Order" on your data:
> x
V1 V2 V3 V4 V5
1 1 12345678 Soc101 34 02-04-2003
2 2 12345678 Soc101 62 31-11-2004
3 3 12345678 Psy104 63 03-05-2003
4 4 23456789 Soc101 73 02-04-2003
5 5 23456789 Psy104 76 25-02-2004
> x$order <- ave(x$V1, x$V2, x$V3, FU
Hi all,
I've found a lot of helpful info regarding identifying and deleting duplicates
but I'd like to do something a little different - I'd like to identify the
duplicate values but instead of deletion, label them with a value.
I am working with historical data regarding school courses:
On Thu, Sep 2, 2010 at 2:33 PM, Greg Snow wrote:
> Suggestion: use the power of R.
>
> If x and y are independent then sorting y based on x is meaningless.
>
> If sorting y based on x is meaningful, then they are not independent.
>
> Trying to force non-independent things to pretend that they are
lp-boun...@r-
> project.org] On Behalf Of Mestat
> Sent: Thursday, September 02, 2010 2:49 PM
> To: r-help@r-project.org
> Subject: [R] Ordering data by variable
>
>
> Hi listers,
> I could order a data that like this:
> x<-c(2,6,8,8,1)
> y<-c(1,6,3,5,4)
> o<
Hi Marcio,
Is this what you want?
x <- c(2,6,8,8,1)
y <- c(1,6,3,5,4)
o <- order(x)
# If you want each vector order by x
x[o]
y[o]
You can also use sort(), but then each vector would be sorted by
itself, not both by x.
HTH,
Josh
On Thu, Sep 2, 2010 at 1:48 PM, Mestat wrote:
>
> Hi listers,
Hi listers,
I could order a data that like this:
x<-c(2,6,8,8,1)
y<-c(1,6,3,5,4)
o<-order(x)
frame<-rbind(x,y)[,o]
But, I would like to know if there is a way to order my data without setting
up a data frame. I would like to keep independent vectors x and y.
Any suggestions?
Thanks in advance,
Mar
phoebe kong wrote:
Hi all,
I have problem in ordering data frame. Could anyone help me?
x
[,1] [,2] [,3]
[1,] "A" "1" "2"
[2,] "G" "3" "2"
[3,] "E" "2" "3"
y
[,1] [,2] [,3]
[1,] "G" "3" "3"
[2,] "A" "3" "3"
[3,] "E" "3" "3"
Are these really data.frames? They looks
Hi all,
I have problem in ordering data frame. Could anyone help me?
> x
[,1] [,2] [,3]
[1,] "A" "1" "2"
[2,] "G" "3" "2"
[3,] "E" "2" "3"
> y
[,1] [,2] [,3]
[1,] "G" "3" "3"
[2,] "A" "3" "3"
[3,] "E" "3" "3"
I would like to order data frame x by the order of column 1 of d
Thanks David. Leaving off the tilde was the problem.
--
View this message in context:
http://n4.nabble.com/ordering-columns-in-a-data-frame-tp1587294p1587491.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org maili
I'm not sure what's incorrect about your result, but the following works:
d=data.frame(a=sample(letters[1:5],10,rep=T),b=rnorm(10),c=sample(1:10,10));
d
d[order(d$a,d$c),]
or, you can use orderBy:
lib(doBy)
orderBy(~a+b,data=d) #use a - sign to sort in descending sequence
Did you leave off the
Dear R users,
I have the following data frame:
PROCHIdate_admission
2 CAO713 1999-12-11
4 CAO713 1999-10-25
21 CAO0001743 1989-05-04
25 CAO0001743 1996-09-12
26 CAO0001743 1989-05-17
27 CAO0001743 1987-09-17
28 CAO0001743 1987-09-19
2
the factor after any such
> change. Proceeding with caution...
>
> Bill
>
> ---
> Wilhelm K. Schwab, Ph.D.
>
>
>
> -Original Message-
> From: Phil Spector [mailto:spec...@stat.berkeley.edu]
> Sent: Thursday, February 25, 2010 7:06 PM
> To: Schwab,Wilh
-
From: Phil Spector [mailto:spec...@stat.berkeley.edu]
Sent: Thursday, February 25, 2010 7:06 PM
To: Schwab,Wilhelm K
Subject: Re: [R] Ordering categories on a boxplot - a serious trap??
Wilhelm -
I don't know if this is correct for your problem because you didn't provide
a re
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Schwab,Wilhelm K
> Sent: Thursday, February 25, 2010 3:51 PM
> To: r-help@r-project.org
> Subject: [R] Ordering categories on a boxplot - a serious trap??
>
Hello all,
I think I probably did something stupid, and R's part was to allow me to do it.
My goal was to control the order of factor levels appearing horizontally on a
boxplot. Enter search engines and perhaps some creative stupidity on my part,
and I came up with the following:
v=r
Hi,
I am trying to add additional columns to a forest plot using the meta package.
The study information and subgroup analysis plotting is handled properly.
For this output the data is ordered first by subgroup label
(rnd.subgroup1 in the example) and second decreasing size of totals
('n' in the e
Hi, Tal,
Tal Galili wrote:
>
> In any case, my question wasn't on how to reorder the columns (that is
> simple), but on how to choose what order to put them in.
>
So is your question answered? Or what exactly is the problem using the
example below?
library(lattice)
parallel(~iris[1:4] | Spec
On Sun, 3 Jan 2010, Tal Galili wrote:
Hi Charles,
Thanks for answering - you are right about the posting guide (sorry).
In any case, my question wasn't on how to reorder the columns (that is
simple), but on how to choose what order to put them in.
OK, and I see you included a reference, so t
Hi Charles,
You're solution is great (and is actually what my professor suggested me to
do today).
In the meantime I searched even more and found this article:
http://davis.wpi.edu/~xmdv/docs/tr0313_osf.pdf
That gives a good description of the problem and of his attempts at solving
it.
I started
Hi Charles,
Thanks for answering - you are right about the posting guide (sorry).
In any case, my question wasn't on how to reorder the columns (that is
simple), but on how to choose what order to put them in.
Thanks,
Tal
Contact
Details:---
On Sat, 2 Jan 2010, Tal Galili wrote:
Hello all,
I am searching for a way in R to re-order variables before presenting them
in a parallel coordinates plot.
So far I didn't find anything within a R related context on how to do this.
I did find some texts talking about how it should be done in g
Hello all,
I am searching for a way in R to re-order variables before presenting them
in a parallel coordinates plot.
So far I didn't find anything within a R related context on how to do this.
I did find some texts talking about how it should be done in general, here
is such example:
http://tiny
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Lisa
> Sent: Wednesday, December 02, 2009 12:30 PM
> To: r-help@r-project.org
> Subject: [R] Ordering numbers
>
>
> Hello all,
>
> I have a se
Greg Snow wrote:
Here is one way:
id <- c(1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 1, 2, 2, 2, 3, 3, 1, 1, 1, 2, 3, 4,
+ 4, 4, 5, 5)
id
[1] 1 1 2 2 2 3 4 4 4 4 1 2 2 2 3 3 1 1 1 2 3 4 4 4 5 5
tmp <- rle(id)
tmp
Run Length Encoding
lengths: int [1:12] 2 3 1 4 1 3 2 3 1 1 ...
values : num [1:12] 1
ginal Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Senthil Kumar M
> Sent: Wednesday, December 02, 2009 1:36 PM
> To: Lisa
> Cc: r-help@r-project.org
> Subject: Re: [R] Ordering numbers
>
> On Wed, Dec 2, 2009 at 3:
l Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Lisa
> Sent: Wednesday, December 02, 2009 1:30 PM
> To: r-help@r-project.org
> Subject: [R] Ordering numbers
>
>
> Hello all,
>
> I have a set of numbers that looks
On Wed, Dec 2, 2009 at 3:30 PM, Lisa wrote:
>
> Hello all,
>
> I have a set of numbers that looks like this:
>
>> id <- c(1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 1, 2, 2, 2, 3, 3, 1, 1, 1, 2, 3, 4,
>> 4, 4, 5, 5)
>> id
> [1] 1 1 2 2 2 3 4 4 4 4 1 2 2 2 3 3 1 1 1 2 3 4 4 4 5 5
>
> Please ignore the bold num
Hello all,
I have a set of numbers that looks like this:
> id <- c(1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 1, 2, 2, 2, 3, 3, 1, 1, 1, 2, 3, 4,
> 4, 4, 5, 5)
> id
[1] 1 1 2 2 2 3 4 4 4 4 1 2 2 2 3 3 1 1 1 2 3 4 4 4 5 5
Please ignore the bold numbers, I just want to make my problem clear.
I am going to or
Try this also:
xtabs(value ~ site + parameter, data = DF)
On Tue, Sep 1, 2009 at 8:59 PM, Krista Chin <0574...@acadiau.ca> wrote:
> Hi,
>
> The lab in which I send my samples return the results in a format that
> is difficult for me to run my analysis. The lab outputs the results
> where each p
Try the reshape package:
> library(reshape)
> cast(DF, site ~ parameter)
site e1 e2 e3 e4 e5
1a 1 3 5 NA NA
2b 2 NA 1 NA NA
3c NA 2 NA 5 4
4d NA 4 NA 3 NA
5e 2 NA NA NA NA
(or the reshape command in R).
On Tue, Sep 1, 2009 at 7:59 PM, Krista Chin<0574...@acadiau.
Hi,
The lab in which I send my samples return the results in a format that
is difficult for me to run my analysis. The lab outputs the results
where each parameter is its own row and its not consistently in the
same order (and not each sample is tested for the same suite of
variables).
e.g.
>d
Hi, Gabor
Yes, I am familiar with tail() function. I use it extensively on a day
to day basis.
In this particular case I needed to order a zoo object by date, after
I have created it with RBloomberg.
Thank you for your time!
Regards,
Sergey
On Thu, Jul 9, 2009 at 14:36, Gabor Grothendieck wrote
One additional thought. If the reason you want to do that is
just so that you can see the last few rows more easily then
tail(Data)
will display the last few rows or tail(Data, 10) will display
the last 10 rows.
On Thu, Jul 9, 2009 at 7:36 AM, Sergey Goriatchev wrote:
> Hi, Gabor
>
> Thank you!
Hi, Gabor
Thank you!
That is exactly what I did, even before your email. :-)
Regards,
Sergey
On Thu, Jul 9, 2009 at 12:52, Gabor Grothendieck wrote:
> To display that object in reverse time order try this:
>
> as.data.frame(Data)[nrow(Data):1, ]
>
>
> On Thu, Jul 9, 2009 at 5:21 AM, Sergey Goria
To display that object in reverse time order try this:
as.data.frame(Data)[nrow(Data):1, ]
On Thu, Jul 9, 2009 at 5:21 AM, Sergey Goriatchev wrote:
> Hello everyone,
>
> Say I have zoo object
>
> x.Date <- as.Date("2003-02-01") + c(1, 3, 7, 9, 14) - 1
> x <- zoo(rnorm(5), x.Date)
> y <- zoo(rt(5
1 - 100 of 118 matches
Mail list logo