{"action":"created","issue":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/241","labels_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/241/comments","events_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/241/events","html_url":"https://github.com/RcppCore/Rcpp/issues/241","id":56009422,"number":241,"title":"enterRNGScope gets fooled by interuption","user":{"login":"romainfrancois","id":2625526,"avatar_url":"https://avatars.githubusercontent.com/u/2625526?v=3","gravatar_id":"","url":"https://api.github.com/users/romainfrancois","html_url":"https://github.com/romainfrancois","followers_url":"https://api.github.com/users/romainfrancois/followers","following_url":"https://api.github.com/users/romainfrancois/following{/other_user}","gists_url":"https://api.github.com/users/romainfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/romainfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainfrancois/subscriptions","organizations_url":"https://api.github.com/users/romainfrancois/orgs","repos_url":"https://api.github.com/users/romainfrancois/repos","events_url":"https://api.github.com/users/romainfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/romainfrancois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-01-30T09:01:35Z","updated_at":"2015-01-30T20:39:10Z","closed_at":null,"body":"See http://stackoverflow.com/questions/28227971/whats-causing-this-strange-random-number-generator-behaviour/28232296#28232296 and hadley/plyr#229\r\n\r\nInteruption fools the business of `enterRNGscope` and `exitRNGScope`. \r\n\r\nOne possible workaround would be for `enterRNGScope` to look up the R frames and identify `Rcpp` function depth, rather than relying on a global setting like `RNGScopeCounter`. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/comments/72266582","html_url":"https://github.com/RcppCore/Rcpp/issues/241#issuecomment-72266582","issue_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/241","id":72266582,"user":{"login":"pitakakariki","id":1023705,"avatar_url":"https://avatars.githubusercontent.com/u/1023705?v=3","gravatar_id":"","url":"https://api.github.com/users/pitakakariki","html_url":"https://github.com/pitakakariki","followers_url":"https://api.github.com/users/pitakakariki/followers","following_url":"https://api.github.com/users/pitakakariki/following{/other_user}","gists_url":"https://api.github.com/users/pitakakariki/gists{/gist_id}","starred_url":"https://api.github.com/users/pitakakariki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitakakariki/subscriptions","organizations_url":"https://api.github.com/users/pitakakariki/orgs","repos_url":"https://api.github.com/users/pitakakariki/repos","events_url":"https://api.github.com/users/pitakakariki/events{/privacy}","received_events_url":"https://api.github.com/users/pitakakariki/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T20:39:10Z","updated_at":"2015-01-30T20:39:10Z","body":"I wonder if a wrapper function would work as a workaround.\r\n\r\n    setSeed <- function(seed) {\r\n\r\n        resetRcppRNG()\r\n        set.seed(seed)\r\n    }\r\n\r\nI'm guessing this would get messy if someone starts playing Inception with R calling Rcpp calling R calling Rcpp, but that's probably even less common than my use case?"}}