Skip to content
Prev 371221 / 398532 Next

Dataframe Manipulation

Hello Ulrik,
Can you please explain this code means how and what this code is doing
because I'm not able to understand it, if you can explain it i can use it
in future by doing some Lil bit manipulation.

Thanks


data_help <-
  data_help %>%
  mutate(Purchase_ID = 1:n()) %>%
  group_by(Purchase_ID) %>%
    do(split_items(.))

cat_help %>% gather("Foo", "Item") %>%
  filter(!is.na(Item)) %>%
    left_join(data_help, by = "Item") %>%
  group_by(Foo, Purchase_ID) %>%
  summarise(Item = paste(Item, collapse = ", ")) %>%
  spread(key = "Foo", value = "Item")
On 31 August 2017 at 13:17, Ulrik Stervbo <ulrik.stervbo at gmail.com> wrote:

            
-- 
hemantsain.com
On 31 August 2017 at 13:17, Ulrik Stervbo <ulrik.stervbo at gmail.com> wrote: