{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/comments/57528413","id":57528413,"diff_hunk":"@@ -123,6 +123,26 @@ let x = 0.0\n end\n ```\n \n+Note that the let block is used here to create a scope to allow assignment of \n+`x` within `@byrow!`.\n+\n+`byrow!` also supports special syntax for allocating new columns to make\n+`byrow!` more useful for data transformations. The syntax `@newcol\n+x::Array{Int}` allocates a new column `:x` with an `Array` container with eltype\n+`Int`. Note that the returned AbstractDataFrame includes these new columns, but","path":"README.md","position":10,"original_position":10,"commit_id":"e10874e85892620e0e732fa53f7c87040adad9a7","original_commit_id":"e10874e85892620e0e732fa53f7c87040adad9a7","user":{"login":"nalimilan","id":1120448,"avatar_url":"https://avatars.githubusercontent.com/u/1120448?v=3","gravatar_id":"","url":"https://api.github.com/users/nalimilan","html_url":"https://github.com/nalimilan","followers_url":"https://api.github.com/users/nalimilan/followers","following_url":"https://api.github.com/users/nalimilan/following{/other_user}","gists_url":"https://api.github.com/users/nalimilan/gists{/gist_id}","starred_url":"https://api.github.com/users/nalimilan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalimilan/subscriptions","organizations_url":"https://api.github.com/users/nalimilan/orgs","repos_url":"https://api.github.com/users/nalimilan/repos","events_url":"https://api.github.com/users/nalimilan/events{/privacy}","received_events_url":"https://api.github.com/users/nalimilan/received_events","type":"User","site_admin":false},"body":"AbstractDataFrame needs backquotes (or just say \"data frame\").\r\n\r\nI find it a bit problematic that the new columns are not added to the original data frame, given that the macro is called `@byrow!`. Is there a technical reason for this?","created_at":"2016-03-27T13:23:57Z","updated_at":"2016-03-27T13:23:57Z","html_url":"https://github.com/JuliaStats/DataFramesMeta.jl/pull/44#discussion_r57528413","pull_request_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/comments/57528413"},"html":{"href":"https://github.com/JuliaStats/DataFramesMeta.jl/pull/44#discussion_r57528413"},"pull_request":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44","id":64264951,"html_url":"https://github.com/JuliaStats/DataFramesMeta.jl/pull/44","diff_url":"https://github.com/JuliaStats/DataFramesMeta.jl/pull/44.diff","patch_url":"https://github.com/JuliaStats/DataFramesMeta.jl/pull/44.patch","issue_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/44","number":44,"state":"open","locked":false,"title":"Add @newcol feature to @byrow!","user":{"login":"tshort","id":636420,"avatar_url":"https://avatars.githubusercontent.com/u/636420?v=3","gravatar_id":"","url":"https://api.github.com/users/tshort","html_url":"https://github.com/tshort","followers_url":"https://api.github.com/users/tshort/followers","following_url":"https://api.github.com/users/tshort/following{/other_user}","gists_url":"https://api.github.com/users/tshort/gists{/gist_id}","starred_url":"https://api.github.com/users/tshort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tshort/subscriptions","organizations_url":"https://api.github.com/users/tshort/orgs","repos_url":"https://api.github.com/users/tshort/repos","events_url":"https://api.github.com/users/tshort/events{/privacy}","received_events_url":"https://api.github.com/users/tshort/received_events","type":"User","site_admin":false},"body":"See #42 for background. Some notes:\r\n\r\n* New columns don't get added to the original DataFrame, only the result.\r\n\r\n* The syntax is based on the suggestion by @nalimilan:\r\n\r\n```julia\r\ndf = DataFrame(A = 1:3, B = [2, 1, 2])\r\ndf2 = @byrow! df begin\r\n    @newcol colX::Array{Float64}\r\n    @newcol colY::DataArray{Int}\r\n    :colX = :B == 2 ? pi * :A : :B\r\n    if :A > 1 \r\n        :colY = :A * :B\r\n    end\r\nend\r\n```","created_at":"2016-03-27T12:57:37Z","updated_at":"2016-03-27T13:23:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7f0fdeb569385b89a4e8bde660493d50196131b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44/commits","review_comments_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44/comments","review_comment_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/44/comments","statuses_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/statuses/e10874e85892620e0e732fa53f7c87040adad9a7","head":{"label":"JuliaStats:ts/byrow-newcol","ref":"ts/byrow-newcol","sha":"e10874e85892620e0e732fa53f7c87040adad9a7","user":{"login":"JuliaStats","id":2761531,"avatar_url":"https://avatars.githubusercontent.com/u/2761531?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaStats","html_url":"https://github.com/JuliaStats","followers_url":"https://api.github.com/users/JuliaStats/followers","following_url":"https://api.github.com/users/JuliaStats/following{/other_user}","gists_url":"https://api.github.com/users/JuliaStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaStats/subscriptions","organizations_url":"https://api.github.com/users/JuliaStats/orgs","repos_url":"https://api.github.com/users/JuliaStats/repos","events_url":"https://api.github.com/users/JuliaStats/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaStats/received_events","type":"Organization","site_admin":false},"repo":{"id":16530347,"name":"DataFramesMeta.jl","full_name":"JuliaStats/DataFramesMeta.jl","owner":{"login":"JuliaStats","id":2761531,"avatar_url":"https://avatars.githubusercontent.com/u/2761531?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaStats","html_url":"https://github.com/JuliaStats","followers_url":"https://api.github.com/users/JuliaStats/followers","following_url":"https://api.github.com/users/JuliaStats/following{/other_user}","gists_url":"https://api.github.com/users/JuliaStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaStats/subscriptions","organizations_url":"https://api.github.com/users/JuliaStats/orgs","repos_url":"https://api.github.com/users/JuliaStats/repos","events_url":"https://api.github.com/users/JuliaStats/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaStats/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaStats/DataFramesMeta.jl","description":"Metaprogramming tools for DataFrames ","fork":false,"url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl","forks_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/forks","keys_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/teams","hooks_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/events","assignees_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/tags","blobs_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/subscription","commits_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/merges","archive_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/downloads","issues_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/deployments","created_at":"2014-02-05T00:16:36Z","updated_at":"2016-03-20T13:19:50Z","pushed_at":"2016-03-27T12:57:37Z","git_url":"git://github.com/JuliaStats/DataFramesMeta.jl.git","ssh_url":"git@github.com:JuliaStats/DataFramesMeta.jl.git","clone_url":"https://github.com/JuliaStats/DataFramesMeta.jl.git","svn_url":"https://github.com/JuliaStats/DataFramesMeta.jl","homepage":null,"size":97,"stargazers_count":53,"watchers_count":53,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":53,"default_branch":"master"}},"base":{"label":"JuliaStats:master","ref":"master","sha":"cd4fdb3440d43f89d169b9b680c0c1b57d826466","user":{"login":"JuliaStats","id":2761531,"avatar_url":"https://avatars.githubusercontent.com/u/2761531?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaStats","html_url":"https://github.com/JuliaStats","followers_url":"https://api.github.com/users/JuliaStats/followers","following_url":"https://api.github.com/users/JuliaStats/following{/other_user}","gists_url":"https://api.github.com/users/JuliaStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaStats/subscriptions","organizations_url":"https://api.github.com/users/JuliaStats/orgs","repos_url":"https://api.github.com/users/JuliaStats/repos","events_url":"https://api.github.com/users/JuliaStats/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaStats/received_events","type":"Organization","site_admin":false},"repo":{"id":16530347,"name":"DataFramesMeta.jl","full_name":"JuliaStats/DataFramesMeta.jl","owner":{"login":"JuliaStats","id":2761531,"avatar_url":"https://avatars.githubusercontent.com/u/2761531?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaStats","html_url":"https://github.com/JuliaStats","followers_url":"https://api.github.com/users/JuliaStats/followers","following_url":"https://api.github.com/users/JuliaStats/following{/other_user}","gists_url":"https://api.github.com/users/JuliaStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaStats/subscriptions","organizations_url":"https://api.github.com/users/JuliaStats/orgs","repos_url":"https://api.github.com/users/JuliaStats/repos","events_url":"https://api.github.com/users/JuliaStats/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaStats/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaStats/DataFramesMeta.jl","description":"Metaprogramming tools for DataFrames ","fork":false,"url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl","forks_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/forks","keys_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/teams","hooks_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/events","assignees_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/tags","blobs_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/subscription","commits_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/merges","archive_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/downloads","issues_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/deployments","created_at":"2014-02-05T00:16:36Z","updated_at":"2016-03-20T13:19:50Z","pushed_at":"2016-03-27T12:57:37Z","git_url":"git://github.com/JuliaStats/DataFramesMeta.jl.git","ssh_url":"git@github.com:JuliaStats/DataFramesMeta.jl.git","clone_url":"https://github.com/JuliaStats/DataFramesMeta.jl.git","svn_url":"https://github.com/JuliaStats/DataFramesMeta.jl","homepage":null,"size":97,"stargazers_count":53,"watchers_count":53,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44"},"html":{"href":"https://github.com/JuliaStats/DataFramesMeta.jl/pull/44"},"issue":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/44"},"comments":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/statuses/e10874e85892620e0e732fa53f7c87040adad9a7"}}}}