0
I have a data.frame that is filtered from another data.frame. (see image below)
However, I would like to filter this data.frame again and retrieve its original indexes in a vector.
Example: Let’s say that Filtrei and the result were the items 1(Jardim), 11(apiário) e 28(museu)
I want a vector V[1,11,28]
, that is, with the original indexes.
All I tried to do was get the sequential indexes back.
example [1,2,3,4,5,6...,11]
.
Other Example:
In my date.frame I have a column with the following vector -> 16.2 0.4 21.0 18.8 0.8 0.8 18.1 1.5 21.1 21.0 1.9
I made a filter to show the lines of my date.frama that were in the column mentioned above values less than or equal to 5.
after the filter the column mentioned above was as follows: 0.4 0.8 0.8 1.5 1.9
after the filter my data.frame was as shown in the figure below:
However, I want to recover the indexes of the corresponding lines the filter information in a vector, following the example, my final answer would be v = [3,12,13,16,40]
Any help or tip on how to do this??
In my case I only have this error message " longer Object length is not a Multiple of Shorter Object length"
– Lucas Freitas
original vector: 16.2 0.4 21.0 18.8 0.8 0.8 18.1 1.5 21.1 21.0 1.9
– Lucas Freitas
vetor filtro: 0.4 0.8 0.8 1.5 1.9
– Lucas Freitas
I did the same procedure, comparing the original with the filtered one to obtain the indices
– Lucas Freitas
My filter in the case is smaller or equal to 5 (in my code this value will be dynamic)
– Lucas Freitas
In case these vectors are columns of my date.
– Lucas Freitas
You can edit your question with this attempt?
– Willian Vieira
I edited the question.
– Lucas Freitas