{"action":"created","issue":{"url":"https://api.github.com/repos/smbache/magrittr/issues/72","labels_url":"https://api.github.com/repos/smbache/magrittr/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/smbache/magrittr/issues/72/comments","events_url":"https://api.github.com/repos/smbache/magrittr/issues/72/events","html_url":"https://github.com/smbache/magrittr/issues/72","id":62235696,"number":72,"title":"Handling two (or more?) streams simultaneously","user":{"login":"klmr","id":38931,"avatar_url":"https://avatars.githubusercontent.com/u/38931?v=3","gravatar_id":"","url":"https://api.github.com/users/klmr","html_url":"https://github.com/klmr","followers_url":"https://api.github.com/users/klmr/followers","following_url":"https://api.github.com/users/klmr/following{/other_user}","gists_url":"https://api.github.com/users/klmr/gists{/gist_id}","starred_url":"https://api.github.com/users/klmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klmr/subscriptions","organizations_url":"https://api.github.com/users/klmr/orgs","repos_url":"https://api.github.com/users/klmr/repos","events_url":"https://api.github.com/users/klmr/events{/privacy}","received_events_url":"https://api.github.com/users/klmr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-16T23:24:46Z","updated_at":"2015-03-20T18:35:55Z","closed_at":null,"body":"This may be taking pipelines a bit too far but it may also be nice to have:\r\n\r\nA common scenario I encounter is that I have two data sources which need to be processed in a certain way, and are then both fed into one function. As an example, consider the case of two non-tidy data sources which I want to join:\r\n\r\n```r\r\na = data.frame(A=1:3, B=2:4, C=3:5)\r\nb = data.frame(A=1:3, B=2:4, C=3:5) * 2\r\naa = melt(a, value.name='A')\r\nbb = melt(b, value.name='B')\r\nresult = inner_join(aa, bb, by  = 'variable')\r\n```\r\n\r\nSomehow I imagine that it could be more readable to write this as a pipeline (at least once the simple `melt` operation here becomes a more complex chain of operations):\r\n\r\n```r\r\nresult = {\r\n    a %>%\r\n    … %>%\r\n    melt(value.name = 'A')\r\n} %++%\r\n{\r\n    b %>%\r\n    … %>%\r\n    melt(value.name = 'B')\r\n} %>%\r\ninner_join(by = 'variable')\r\n```\r\n\r\nThe `%++%` would somehow construct a stream “tuple” here.\r\n\r\nI’m not even convinced myself that this has any advantage over the first, stream-less variant. I’m also not aware of any other programming languages which would support this, so there may not be much precedence (but visual languages where the developer constructs streams, such as Knime, do of course support this)."},"comment":{"url":"https://api.github.com/repos/smbache/magrittr/issues/comments/84096307","html_url":"https://github.com/smbache/magrittr/issues/72#issuecomment-84096307","issue_url":"https://api.github.com/repos/smbache/magrittr/issues/72","id":84096307,"user":{"login":"smbache","id":6285210,"avatar_url":"https://avatars.githubusercontent.com/u/6285210?v=3","gravatar_id":"","url":"https://api.github.com/users/smbache","html_url":"https://github.com/smbache","followers_url":"https://api.github.com/users/smbache/followers","following_url":"https://api.github.com/users/smbache/following{/other_user}","gists_url":"https://api.github.com/users/smbache/gists{/gist_id}","starred_url":"https://api.github.com/users/smbache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smbache/subscriptions","organizations_url":"https://api.github.com/users/smbache/orgs","repos_url":"https://api.github.com/users/smbache/repos","events_url":"https://api.github.com/users/smbache/events{/privacy}","received_events_url":"https://api.github.com/users/smbache/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T18:35:55Z","updated_at":"2015-03-20T18:35:55Z","body":"Sometimes I've wanted to do these kind of things, but I usually end up concluding that it is probably too much of the good stuff :)"}}