Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

R repeat automatically: create new df if change in variable

$
0
0

I have a simple grouping function that I need to apply to many different cases in one dataframe. For each character change in "scenario" I would like to create a new dataframe. Thanks for your help

    scenario_1 <- subset(data_ag, scenario == "0.1-0.3-0.01-1-0.3-0.35") 
    scenario_1 <- arrange(scenario_1, desc(X.step.))

and I would like to have something like:

    scenario_n+1 <- subset(data_ag, when scenario changes) 
    scenario_n+1 <- arrange(scenario_n+1, desc(X.step.))

Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>