[R-sig-Geo] Subsetting dataframe by all factor levels

Rich Shepard r@hep@rd @ending from @ppl-eco@y@@com
Fri Sep 14 20:05:43 CEST 2018


On Fri, 14 Sep 2018, Phil Radtke wrote:

> would something as simple as this do what you need?
> rainfall_by_site <- split(rainfall,rainfall$name)

Phil,

   Yes, it certainly would do the job.

> I found this on stackoverflow by the web search: R create separate data
> frame based on factor
> https://stackoverflow.com/questions/9713294/split-data-frame-based-on-levels-of-a-factor-into-new-data-frames

   Either I missed this hit when I tried the same search string or duckduckgo
missed it.

   Thanks very much.

Regards,

Rich



More information about the R-sig-Geo mailing list