Displaying 20 results from an estimated 200 matches similar to: "Sort a data frame"
2004 Jul 21
3
How to sort TWO columns ?
Dear ALL,
I fear my question has already been answered many times before, but I
haven't fund that in archives...
I am working on spatial datasets and, in most arrays I'm handling, there are
two columns dedicated to (x,y)-coords.
For different reasons - notably to draw image() plots, I need to have these
two columns sorted in increasing order.
But sort() and order() seem to apply to
2004 Aug 06
2
list of frames without first element
R-help,
I have a list of several data frames.
I want to compute the "rowSums" of the columns of these data frames but first one.
Something like this
lapply(my.list,rowSums)
Thank you
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298
2004 Jun 17
3
How to order a vector
Hi all
I have a vector like this
2003 2002 2001 2000 1999 1998 1997 1996
106 105 106 106 105 106 101 107
How can I get it sorted right(1996....2003)?
Thank you
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
2004 Jul 27
1
list problem
Hi all,
I have the folowing frame(there are more columns than shown),
1 2 3 4 5
Year Total Tus Whi Norw
1994 1.00 1830 0 355
1995 1.00 0 0 0
1995 1.00 0 0 0
1995 1.00 4910 4280 695
1997 1.00 0 0
2004 Jul 26
5
aggregate function
Hi all,
I have the folowing frame(there are more columns than shown),
1 2 3 4 5
Year Total Tus Whi Norw
1994 1.00 1830 0 355
1995 1.00 0 0 0
1995 1.00 0 0 0
1995 1.00 4910 4280 695
1997 1.00 0 0
2004 Apr 20
1
R1.9.0
I have just installed R 1.9.0 on my computer(Windows XP) and uninstalled 1.8.1
When Itry to execute .RData I'm asked to specify the program to open it.But whe I do it I get a message ".RData is not a valid Win32 program"
Can anyone help please?
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
Faroe Islands
Phone: +298 353900
2004 Jul 20
1
Problem with plot
Hi all
I'm trying to plot 2 columns of a frame but whatever option I choose for argument "type" I always get bars with height equal to 1.
I quit and restart but problem remais
Help!
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax:
2004 Aug 11
2
type III sum of squares
R-help
What are the strengths and weakness of 'aov' in 'car' package?
My model looks something like this :
library(car)
aov(lm(fish.length~zone*area,data=my.data))
Thank you
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax:
2004 Aug 16
3
adding sem to a plot
R-help,
I have a barplot and I wish to add standard erros (or deviations) bars to it.
How?
Thank you
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
E-mail: luisr at frs.fo
Web: www.frs.fo
2004 Aug 17
2
levels of factor
R-help,
I have a data frame wich I subset like :
a <- subset(df,df$"column2" %in% c("factor1","factor2") & df$"column2"==1)
But when I type levels(a$"column2") I still get the same levels as in df (my original data frame)
Why is that?
Is it right?
Luis
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
2004 Jul 23
2
retrieve rows from frame assuming criterion
Hi all,
I have a data frame in which one column(PUNTAR) is of character type.
What I want is to retrieve is the frame but only with those rows matching elements of PUNTAR with a list characters (e.g c("IX49","IX48") )
Year TUR STODNR PUNTAR
1994 9412 94020061 IX49
1994 9412 94020062 IX48
1994 9412 94020063 X32
1994 9412 94020065 X23
1994 9412
2004 Aug 13
2
lapply problem
R-help,
I wish to replace NULL elements(or missing) in the following list :
> z2
$cod
mean sd
62.56190 12.65452
$haddock
mean sd
36.61490 11.50365
$ling
mean sd
86.17949 20.43587
$saithe
mean sd
50.275847 5.453606
$whiting
NULL
$"norway pout"
mean sd
13.739623 1.393104
$"great silver smelt"
mean
2004 Aug 05
1
function output
I have the next function :
"extracting.lgddata"<-function(channel)
{
library(RODBC)
channel<-odbcDriverConnect("")
.......
.......
}
...... is just a sequence of SQL selects.
But when I try to call the objects created from the select they do not seem to have been created.
I checked with ls() and they actually do not exist.
What is the problem?
Thank you
Luis Ridao
2004 Aug 13
1
barplot and names.arg
R-help
Is there any option to get closer the x-axis and names.arg from barplot?
Thank you
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-110 T??rshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
E-mail: luisr at frs.fo
Web: www.frs.fo
2004 Aug 18
1
function(...) {}
R-help
Assignments within functions are local and temporary,right?(function 1)
If arguments to another function (function 2) are objects created in function 1 and need to call function 2,,,,,,,then it won't work,Am i right?
I have nested the functions but still do not work.
How can this (it may be simple but I don' know how to get around this) be done??
Thank you
Luis Ridao Cruz
2004 Jun 16
1
Fwd: problem in long select from RODBC
Luis Ridao Cruz
Fiskiranns?knarstovan
N?at?n 1
P.O. Box 3051
FR-110 T?rshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
E-mail: luisr at frs.fo
Web: www.frs.fo
-------------- next part --------------
An embedded message was scrubbed...
From: "Luis Rideau Cruz"
2004 Jul 23
0
retrieve rows from frame assuming criterion [corrected]
Still wrong:
> x <- data.frame(a = sample(letters[1:3], 10, replace=T), b=1:10)
> x
a b
1 a 1
2 a 2
3 b 3
4 b 4
5 a 5
6 a 6
7 b 7
8 b 8
9 b 9
10 c 10
> subset(x, a == c("b", "c"))
a b
3 b 3
7 b 7
9 b 9
10 c 10
> subset(x, a %in% c("b", "c"))
a b
3 b 3
4 b 4
7 b 7
8 b 8
9 b 9
10 c 10
What matters
2004 Jul 23
1
R: retrieve rows from frame assuming criterion [corrected]
sorry for my previus (WRONG)
answer, as someone already pointed out
a solution could be
subset(data, PUNTAR==c("IX49","IX48"))
> -----Messaggio originale-----
> Da: Guazzetti Stefano
> Inviato: venerd?? 23 luglio 2004 15.55
> A: 'Luis Rideau Cruz'; r-help at stat.math.ethz.ch
> Oggetto: R: [R] retrieve rows from frame assuming criterion
>
>
2004 Apr 22
3
fill up a matrix
Hi all,
I want to fill in this matrix vectors (by column) without overwriting the first elements in column 1995.
Is there any other way than concatenate the first element with the vector and then assign this new vector
to the column in matrix?
matrix[,"3"]<-c(1591,"vector")
matrix[,"4"]<-c(405,"vector")
...
...
2007 Aug 07
2
R and excell differences in calculation F distributionfunction
R-help,
I'm trying to work out the density function by doing:
> df(5.22245, 3, 22)
[1] 0.005896862
> df(15.20675, 6, 4)
[1] 0.001223825
In excell the result is :
0.0071060464 <*> FDIST(5.22245,3,22)
0.0100001406 <--> FDIST(15.20675,6,4)
>From my point of view the differences in the second case
are substantial.
Can anyone give me a hint on this?
Thanks in