Skip to content

Commit

Permalink
uc2 dplyr17 2
Browse files Browse the repository at this point in the history
  • Loading branch information
darwinanddavis committed Aug 25, 2024
1 parent 55d6e69 commit e9c65db
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
4 changes: 3 additions & 1 deletion UsefulCode2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,9 @@ Separate/split df into individual dfs based on repeating value in a column
df %>%
mutate(trips = cumsum(IDS == 0)) %>% # create new helper col between every instance of 0 in IDS
group_by(trips) %>% # group by this helper col
group_split() # spit into individual dfs
group_split() %>% # spit into individual dfs
set_names(LETTERS[1:length(.)]) %>% # create new names for each df
imap(~write_csv(.x, paste0(.y, ".csv"))) # save each object '.x' as '.y' to dir as csv based on their list names
```


Expand Down
38 changes: 20 additions & 18 deletions UsefulCode2.html

Large diffs are not rendered by default.

0 comments on commit e9c65db

Please sign in to comment.