Skip to content

Instantly share code, notes, and snippets.

View endlesstour's full-sized avatar
😊

endlesstour

😊
View GitHub Profile
@jflanaga
jflanaga / split-df-save.R
Last active June 8, 2023 12:02
R Script for splitting data frame and then saving separate .csv
#----------------------------------------------------------------------------------------
# File:
# Author: Joseph Flanagan, adopted from https://stackoverflow.com/questions/10002021/split-dataframe-into-multiple-output-files-in-r
# email: [email protected]
# Purpose: Split a dataframe by group, then save each as separate .csv file
#----------------------------------------------------------------------------------------
# new tidyverse solution with `group_walk`
library(dplyr)
library(readr)