On Mon, Mar 7, 2011 at 1:38 AM, David Winsemius wrote:
> subset(x[order(x$Species1), ], Sepal.Length==6.7 )
>
Thank you all for the suggestions. Now I can do exactly what I wanted. Regards
Liviu
__
R-help@r-project.org mailing list
https://stat.ethz.ch
On Mar 6, 2011, at 7:34 PM, David Winsemius wrote:
On Mar 6, 2011, at 6:05 PM, Liviu Andronic wrote:
On Sun, Mar 6, 2011 at 11:53 PM, Liviu Andronic > wrote:
On Sun, Mar 6, 2011 at 11:49 PM, Liviu Andronic > wrote:
Dear all
This may be obvious, but I cannot get it working. I'm trying to
su
On Mar 6, 2011, at 6:05 PM, Liviu Andronic wrote:
On Sun, Mar 6, 2011 at 11:53 PM, Liviu Andronic > wrote:
On Sun, Mar 6, 2011 at 11:49 PM, Liviu Andronic > wrote:
Dear all
This may be obvious, but I cannot get it working. I'm trying to
subset
& sort a data frame in one go.
x <- iris
x$Speci
Hi:
One approach is through the data.table package:
library(data.table)
df <- as.data.frame(data.table(iris, key = 'Species')[Sepal.Length == 6.7])
str(df)
Using Species as a key variable automatically sorts by Species; the
bracketing allows you to subset on Sepal.Length == 6.7.
ddply() in the
On Mar 6, 2011, at 5:49 PM, Liviu Andronic wrote:
Dear all
This may be obvious, but I cannot get it working. I'm trying to subset
& sort a data frame in one go.
x <- iris
x$Species1 <- as.character(x$Species)
##subsetting alone works fine
with(x, x[Sepal.Length==6.7,])
##sorting alone works fin
On Sun, Mar 6, 2011 at 11:53 PM, Liviu Andronic wrote:
> On Sun, Mar 6, 2011 at 11:49 PM, Liviu Andronic
> wrote:
>> Dear all
>> This may be obvious, but I cannot get it working. I'm trying to subset
>> & sort a data frame in one go.
>> x <- iris
>> x$Species1 <- as.character(x$Species)
>> ##sub
On Sun, Mar 6, 2011 at 11:49 PM, Liviu Andronic wrote:
> Dear all
> This may be obvious, but I cannot get it working. I'm trying to subset
> & sort a data frame in one go.
> x <- iris
> x$Species1 <- as.character(x$Species)
> ##subsetting alone works fine
> with(x, x[Sepal.Length==6.7,])
> ##sorti
Dear all
This may be obvious, but I cannot get it working. I'm trying to subset
& sort a data frame in one go.
x <- iris
x$Species1 <- as.character(x$Species)
##subsetting alone works fine
with(x, x[Sepal.Length==6.7,])
##sorting alone works fine
with(x, x[order(Sepal.Length, rev(sort(Species1))),]
8 matches
Mail list logo