Working on several dataframes with similar names

Hi,

I am currently analyzing some data from an experiment.
I measured activity after 24, 48, 72 and 96 hours.

I named my different dataframes like "Time24h, Time48h, Time72h, Time96h".
When I analyzed my data, I use a workflow that I need to follow for each time point/dataframe.

When I use a command, is it possible to use for example a symbol (e.g. Time**) to apply the command to all the dataframes with a name starting by "Time...", in my case "Time24h, Time48h, Time72h, Time96h".

Thank you in advance,

Hi @fgaascht,
One solution is to use the lapply function and its relatives in R; see help(lapply).
Another option is the merge the dataframes together with an appropriate factor column to indicate "Time", and then work on the full dataframe using

library(dplyr)
full.df %>%
    group_by(Time) %>%
    your_analysis_commands_here

The second approach has the advantage that all your data are in the one place, ready for faceted plotting, etc.
HTH

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