5
I have a data.Frame
with the following behaviour:
values ind
1 10.82000 2011-01-03
2 11.75000 2011-01-03
3 10.82000 2011-01-03
4 11.75000 2011-01-03
5 10.82000 2011-01-03
6 11.75000 2011-01-03
7 10.84048 2011-01-04
8 11.79000 2011-01-04
9 10.87095 2011-01-05
10 11.84000 2011-01-05
11 10.88928 2011-01-06
12 11.88000 2011-01-06
13 10.92000 2011-01-07
14 12.03000 2011-01-07
15 10.93984 2011-01-10
...
121 11.67614 2011-03-03
122 12.47000 2011-03-03
123 11.67481 2011-03-04
124 12.44000 2011-03-04
125 11.68514 2011-03-09
126 12.44000 2011-03-09
127 11.68514 2011-03-09
128 12.44000 2011-03-09
129 11.68514 2011-03-09
130 12.44000 2011-03-09
131 11.68514 2011-03-09
132 12.44000 2011-03-09
133 11.68514 2011-03-09
134 12.44000 2011-03-09
135 11.67746 2011-03-10
Here’s the thing, I have to delete lines 1 through 4, leaving lines 5 and 6. I need to delete lines 125 through 133 leaving lines 134 and 135.
Note that it would be interesting to delete in order. As soon as I see that there are repetitions two by two I would like to go erasing until I leave the last repetition.
Can you create something? As I am a beginner in R I am since yesterday trying to create something but it is very difficult.
The cool thing is to see your code, so you can see your logic and answer better. Can [Edit] the question to add details.
– brasofilo
It is not really a code. It is only the command Matrix[-c(1:4,15:18, 29:32, 43:46, 55:58,),].
– cassius
as you mentioned
estou tentando criar um codigo/função
in the question...– brasofilo
Okay. I’ll edit it.
– cassius
Note the actual effect of the duplicated function. It counts the number of duplicates and not the number of repeated lines. Duplicated negation counts the number of nonduplicates and counts the 1st of a series of duplicate lines. Worth checking.
– C Lederman