How to filter rows depending on the column?

Hello everyone,

I have a time series analysis dataset I need to analyze. For each timepoint I have 9 rows, one for each z-plane. What I would like to do is to filter the rows so that for each columnm I get only the row containing the data of the z-plane that cell was found in.

It is hard to explain properly so I will make an example:

I have column s1n1, which represents the data over time of all the z-stacks belonging to region of interest n1 that I identified in stack 1 (s1 refers to the stack, n1 to the region). This column has 1800 rows, which can be seen as the repetition of 9 planes for 200 timepoints. What I want to do is to filter out the first row of each of these repetition, as I am interested in the data from stack 1 only (since the region was identified in stack 1), and get rid of the remaining 8 rows.

I want to do this for all the 50 regions/columns that I have, but I want to be sure that it filters the correct row (which is specified in the name of the column itself) so that I end up having 50 columns each with 200 rows, each of which represents the measure in the correct plane the region was initially identified in.

I apologize if this is confusing, if it doesn't make sense I can explain it again the comments.

Thank you in advance


To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.