[R] delete rows
sonchawan tamkaew
psu17772 at hotmail.com
Fri May 3 17:08:51 CEST 2002
Hello,
I would like to know how to delete some rows?
Suppose I have a large data frame look something like this:
x1 x2 x3 ..............
a 1 0.45
b 1 0.41
c 0 0.43
a 1 0.39
d 1 0.40
e 0 0.41
r 1 0.42
a 0 0.46
. . ..
I would like to have another data frame which has all columns like the
original one but if any rows have the same values in x1, then keep only the
first row and delet the rest. Is it any way to make it look like this?
x1 x2 x3 ..............
a 1 0.45
b 1 0.41
c 0 0.43
d 1 0.40
e 0 0.41
r 1 0.42
. . ..
Another question is I downloaded data from Oracle database to R which looks
like this:
DATE,'yyyy,ww' TRD_AMT
1 2001,01 57.99330
2 2001,01 59.52926
3 2001,03 61.31018
4 2001,04 59.07095
5 2001,05 62.29583
6 2001,06 63.96679
It's weekly data and I would like to plot it. How could I do that?
Many thanks,
Sonchawan
_________________________________________________________________
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list