{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/haven/issues/37","labels_url":"https://api.github.com/repos/hadley/haven/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/hadley/haven/issues/37/comments","events_url":"https://api.github.com/repos/hadley/haven/issues/37/events","html_url":"https://github.com/hadley/haven/issues/37","id":59978644,"number":37,"title":"write_dta leads to R crashing ","user":{"login":"fhollenbach","id":1372634,"avatar_url":"https://avatars.githubusercontent.com/u/1372634?v=3","gravatar_id":"","url":"https://api.github.com/users/fhollenbach","html_url":"https://github.com/fhollenbach","followers_url":"https://api.github.com/users/fhollenbach/followers","following_url":"https://api.github.com/users/fhollenbach/following{/other_user}","gists_url":"https://api.github.com/users/fhollenbach/gists{/gist_id}","starred_url":"https://api.github.com/users/fhollenbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhollenbach/subscriptions","organizations_url":"https://api.github.com/users/fhollenbach/orgs","repos_url":"https://api.github.com/users/fhollenbach/repos","events_url":"https://api.github.com/users/fhollenbach/events{/privacy}","received_events_url":"https://api.github.com/users/fhollenbach/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-05T16:43:10Z","updated_at":"2015-03-05T18:05:36Z","closed_at":"2015-03-05T18:03:01Z","body":"Created a data frame using simulated data and tried to save it as a dta file, this led R to crash with segfault error. Using R version 3.1.2 on a Mac with OSX 10.10.2.\r\n\r\nExample code:\r\n```R\r\nlibrary(haven)\r\nlibrary(plyr)\r\n\r\nset.seed(12345)\r\nN=300\r\nvar1 = rnorm(N,0,1.5)\r\nvar2 = rnorm(N,2,5)\r\nvar3 = runif(N,-10,10)\r\n\r\ndataForStata = data.frame(var1,var2,var3)\r\nnames(dataForStata) = c(\"var1\",\"var2\",\"var3\")\r\nwrite_dta(dataForStata,path=\"~/Desktop/\")\r\n```\r\n\r\nRunning the code produces the following error:\r\n```R\r\n> write_dta(dataForStata,path=\"~/Desktop/\")\r\n\r\n *** caught segfault ***\r\naddress 0x68, cause 'memory not mapped'\r\n\r\nTraceback:\r\n 1: .Call(\"haven_write_dta\", PACKAGE = \"haven\", data, path)\r\n 2: write_dta(dataForStata, path = \"~/Desktop/\")\r\n\r\nPossible actions:\r\n1: abort (with core dump, if enabled)\r\n2: normal R exit\r\n3: exit R without saving workspace\r\n4: exit R saving workspace\r\n```\r\n\r\nR session info:\r\n```R\r\nsessionInfo()\r\nR version 3.1.2 (2014-10-31)\r\nPlatform: x86_64-apple-darwin14.0.0 (64-bit)\r\n\r\nlocale:\r\n[1] en_US/en_US/en_US/C/en_US/en_US\r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n[1] plyr_1.8.1       haven_0.1.1.9000\r\n\r\nloaded via a namespace (and not attached):\r\n[1] Rcpp_0.11.4\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hadley/haven/issues/comments/77415813","html_url":"https://github.com/hadley/haven/issues/37#issuecomment-77415813","issue_url":"https://api.github.com/repos/hadley/haven/issues/37","id":77415813,"user":{"login":"afleishman","id":6239089,"avatar_url":"https://avatars.githubusercontent.com/u/6239089?v=3","gravatar_id":"","url":"https://api.github.com/users/afleishman","html_url":"https://github.com/afleishman","followers_url":"https://api.github.com/users/afleishman/followers","following_url":"https://api.github.com/users/afleishman/following{/other_user}","gists_url":"https://api.github.com/users/afleishman/gists{/gist_id}","starred_url":"https://api.github.com/users/afleishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afleishman/subscriptions","organizations_url":"https://api.github.com/users/afleishman/orgs","repos_url":"https://api.github.com/users/afleishman/repos","events_url":"https://api.github.com/users/afleishman/events{/privacy}","received_events_url":"https://api.github.com/users/afleishman/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T18:05:35Z","updated_at":"2015-03-05T18:05:35Z","body":"Glad it worked out :). I had a similar issue on Ubuntu... I forgot the first '/' at the beginning of the path and it was crashing every time I'd run the code."}}