{"action":"opened","issue":{"url":"https://api.github.com/repos/iangow/filings/issues/4","repository_url":"https://api.github.com/repos/iangow/filings","labels_url":"https://api.github.com/repos/iangow/filings/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/iangow/filings/issues/4/comments","events_url":"https://api.github.com/repos/iangow/filings/issues/4/events","html_url":"https://github.com/iangow/filings/issues/4","id":220481843,"number":4,"title":"Add code for creating accession numbers","user":{"login":"iangow","id":1708790,"avatar_url":"https://avatars2.githubusercontent.com/u/1708790?v=3","gravatar_id":"","url":"https://api.github.com/users/iangow","html_url":"https://github.com/iangow","followers_url":"https://api.github.com/users/iangow/followers","following_url":"https://api.github.com/users/iangow/following{/other_user}","gists_url":"https://api.github.com/users/iangow/gists{/gist_id}","starred_url":"https://api.github.com/users/iangow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iangow/subscriptions","organizations_url":"https://api.github.com/users/iangow/orgs","repos_url":"https://api.github.com/users/iangow/repos","events_url":"https://api.github.com/users/iangow/events{/privacy}","received_events_url":"https://api.github.com/users/iangow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-09T16:28:21Z","updated_at":"2017-04-09T16:28:21Z","closed_at":null,"body":"Here is some code:\r\n\r\n```r\r\nlibrary(dplyr)\r\nlibrary(RPostgreSQL)\r\n\r\npg <- src_postgres()\r\n\r\ndbGetQuery(pg$con, \"SET work_mem='10GB'\")\r\nfilings <- tbl(pg, sql(\"SELECT * FROM filings.filings\"))\r\nacc_no_regex <- \"edgar/data/\\\\d+/(.*)\\\\.txt$\"\r\nacc_nos <- \r\n    filings %>%\r\n    mutate(accession_no = regexp_replace(file_name, acc_no_regex, \"\\\\1\")) %>%\r\n    mutate(cik = as.integer(cik)) %>%\r\n    select(cik, accession_no) %>%\r\n    compute(indexes = c(\"accession_no\", \"cik\"))\r\n```"}}
{"actor":{"display_login":"iangow"}}