From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vikas Rawal Subject: Re: Trouble evaluating R source code blocks with C-c C-c Date: Sun, 29 May 2016 18:01:06 +0530 Message-ID: <5002C640-1102-4D23-B67A-8A4F2B62521D@agrarianresearch.org> References: <2BE21056-50D3-49CE-8B0D-5467D182B7B5@agrarianresearch.org> <2E8B017B-F4AB-454D-81A1-E61F55F4F958@agrarianresearch.org> Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_66381BDD-C630-4942-A1F5-182E98865ECA" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6zsC-00068G-Nz for emacs-orgmode@gnu.org; Sun, 29 May 2016 08:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6zs8-0003lU-AJ for emacs-orgmode@gnu.org; Sun, 29 May 2016 08:31:15 -0400 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]:34391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6zs7-0003lC-No for emacs-orgmode@gnu.org; Sun, 29 May 2016 08:31:12 -0400 Received: by mail-pf0-x22d.google.com with SMTP id 62so11537609pfd.1 for ; Sun, 29 May 2016 05:31:11 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Charles C. Berry" Cc: William Denton , org-mode mailing list --Apple-Mail=_66381BDD-C630-4942-A1F5-182E98865ECA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Does this back-trace say anything? sit-for(0.25) org-babel-comint-eval-invisibly-and-wait-for-file("type2" = "/var/folders/hj/hqfjch716qg5php160jbtfgh0000gn/T/babel-53134TSq/R-53134IW= W" "{\n function(object,transfer.file) {\n object\n = invisible(\n if (\n inherits(\n = try(\n {\n = tfile<-tempfile()\n write.table(object, = file=3Dtfile, sep=3D\"\\t\",\n = na=3D\"nil\",row.names=3DFALSE,col.names=3DFALSE,\n = quote=3DFALSE)\n = file.rename(tfile,transfer.file)\n },\n = silent=3DTRUE),\n \"try-error\"))\n = {\n if(!file.exists(transfer.file))\n = file.create(transfer.file)\n }\n = )\n = }\n}(object=3D.Last.value,transfer.file=3D\"/var/folders/hj/hqfjch716qg5ph= p160jbtfgh0000gn/T/babel-53134TSq/R-53134IWW\")") org-babel-R-evaluate-session("type2" = "lm(log_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+s= tate_region,data=3Dregdata,weights=3Dweight)->reg\nlm(adj_cal~sector+Socia= lGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+state_region,data=3Dregda= ta,weights=3Dweight)->reg.1\nlibrary(car)\nlibrary(lmtest)\nlibrary(sandwi= ch)\ncov1 <- vcovHC(reg, type =3D \"HC1\")\nrobust_se <- = sqrt(diag(cov1))\n\ncov2 <- vcovHC(reg.1, type =3D = \"HC1\")\nrobust_se2 <- sqrt(diag(cov2))\n = # Adjust F statistic\nwald_results <- waldtest(reg, vcov =3D = cov1)\nwald_results2 <- waldtest(reg.1, vcov =3D cov2)\n\n = #coeftest(reg, vcov =3D = hccm)->reg2\noptions(scipen =3D = 999)\nlibrary(stargazer)\nstargazer(reg.1,reg,\n align=3DTRUE,\n = title=3D\"Regression of per capita calorie intake with monthly = per capita consumer expenditure, and demographic and other = socio-economic variables\",\n dep.var.labels =3D c(\"Per capita = calorie intake\",\"Log of per capita calorie intake\"),\n = se=3Dlist(NULL,robust_se,robust_se2),\n omit=3D\"state\",\n = model.numbers=3DFALSE,\n report =3D \"vct*\",\n = single.row=3DTRUE,\n omit.labels =3D \"State and region = dummies\")" value ("replace" "scalar" "latex") nil nil) org-babel-R-evaluate("type2" = "lm(log_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+s= tate_region,data=3Dregdata,weights=3Dweight)->reg\nlm(adj_cal~sector+Socia= lGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+state_region,data=3Dregda= ta,weights=3Dweight)->reg.1\nlibrary(car)\nlibrary(lmtest)\nlibrary(sandwi= ch)\ncov1 <- vcovHC(reg, type =3D \"HC1\")\nrobust_se <- = sqrt(diag(cov1))\n\ncov2 <- vcovHC(reg.1, type =3D = \"HC1\")\nrobust_se2 <- sqrt(diag(cov2))\n = # Adjust F statistic\nwald_results <- waldtest(reg, vcov =3D = cov1)\nwald_results2 <- waldtest(reg.1, vcov =3D cov2)\n\n = #coeftest(reg, vcov =3D = hccm)->reg2\noptions(scipen =3D = 999)\nlibrary(stargazer)\nstargazer(reg.1,reg,\n align=3DTRUE,\n = title=3D\"Regression of per capita calorie intake with monthly = per capita consumer expenditure, and demographic and other = socio-economic variables\",\n dep.var.labels =3D c(\"Per capita = calorie intake\",\"Log of per capita calorie intake\"),\n = se=3Dlist(NULL,robust_se,robust_se2),\n omit=3D\"state\",\n = model.numbers=3DFALSE,\n report =3D \"vct*\",\n = single.row=3DTRUE,\n omit.labels =3D \"State and region = dummies\")" value ("replace" "scalar" "latex") nil nil) = org-babel-execute:R("lm(log_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+f= oodprice+log(MPCE)+state_region,data=3Dregdata,weights=3Dweight)->reg\nlm(= adj_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+state= _region,data=3Dregdata,weights=3Dweight)->reg.1\nlibrary(car)\nlibrary(lmt= est)\nlibrary(sandwich)\ncov1 <- vcovHC(reg, type =3D = \"HC1\")\nrobust_se <- sqrt(diag(cov1))\n\ncov2 <- = vcovHC(reg.1, type =3D \"HC1\")\nrobust_se2 <- sqrt(diag(cov2))\n = # Adjust F statistic\nwald_results <- = waldtest(reg, vcov =3D cov1)\nwald_results2 <- waldtest(reg.1, vcov =3D = cov2)\n\n #coeftest(reg, vcov =3D = hccm)->reg2\noptions(scipen =3D = 999)\nlibrary(stargazer)\nstargazer(reg.1,reg,\n align=3DTRUE,\n = title=3D\"Regression of per capita calorie intake with monthly = per capita consumer expenditure, and demographic and other = socio-economic variables\",\n dep.var.labels =3D c(\"Per capita = calorie intake\",\"Log of per capita calorie intake\"),\n = se=3Dlist(NULL,robust_se,robust_se2),\n omit=3D\"state\",\n = model.numbers=3DFALSE,\n report =3D \"vct*\",\n = single.row=3DTRUE,\n omit.labels =3D \"State and region = dummies\")" ((:colname-names) (:rowname-names) (:result-params "replace" = "scalar" "latex") (:result-type . value) (:comments . "") (:shebang . = "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") = (:exports . "results") (:results . "replace scalar latex") (:hlines . = "no") (:session . "type2"))) org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe() org-babel-execute-maybe() org-babel-execute-safely-maybe() run-hook-with-args-until-success(org-babel-execute-safely-maybe) org-ctrl-c-ctrl-c(nil) call-interactively(org-ctrl-c-ctrl-c nil nil) command-execute(org-ctrl-c-ctrl-c) > On 28-May-2016, at 10:31 pm, Charles C. Berry = wrote: >=20 >=20 > p.s. one more thing - below >=20 > On Sat, 28 May 2016, Charles C. Berry wrote: >=20 >> On Sat, 28 May 2016, William Denton wrote: >>=20 >>> On 28 May 2016, Vikas Rawal wrote: >>>> Thanks John. Appreciate that you cared to respond to such a vague = query. I am at a loss with this one. It does not happen all the time. I = think it happens when I am processing large datasets, and CPUs and RAM = of my system are struggling to keep up. But I could be wrong. >>> I've had the same kind of thing happen---but C-g (sometimes many) to = kill the command, then rerunning, usually works without any trouble. = Some strange combination of CPU and RAM and all that, the kind of thing = that's not easily reproducible. >>=20 >> Try this: customize `debug-on-quit' to `t' (and set for current = session). >>=20 >> Then when you have to quit via C-g, you will get a backtrace showing = where the process was hanging and how it got there. This might be = helpful in figuring out what is going on. >>=20 >> Run your code and when you finally have to C-g out copy the = *Backtrace* buffer and report it back here (or on the ESS list if = appropriate). >>=20 >=20 > After you copy the buffer, you should type 'q' in the *Backtrace* = buffer to finish up or you may have some odd messages and hangups = afterwards. >=20 > Chuck --Apple-Mail=_66381BDD-C630-4942-A1F5-182E98865ECA Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Does this back-trace say anything?

  = sit-for(0.25)
  = org-babel-comint-eval-invisibly-and-wait-for-file("type2" = "/var/folders/hj/hqfjch716qg5php160jbtfgh0000gn/T/babel-53134TSq/R-53134IW= W" "{\n    function(object,transfer.file) {\n     =    object\n        invisible(\n   =          if (\n         =        inherits(\n         =            try(\n       =                  {\n   =                     =      tfile<-tempfile()\n         =                   =  write.table(object, file=3Dtfile, sep=3D\"\\t\",\n               =                     =      na=3D\"nil\",row.names=3DFALSE,col.names=3DFALSE,\n =                     =                   =  quote=3DFALSE)\n               =             =  file.rename(tfile,transfer.file)\n         =                },\n   =                     =  silent=3DTRUE),\n               =      \"try-error\"))\n           =      {\n               =      if(!file.exists(transfer.file))\n     =                   =  file.create(transfer.file)\n           =      }\n            )\n =   =  }\n}(object=3D.Last.value,transfer.file=3D\"/var/folders/hj/hqfjch71= 6qg5php160jbtfgh0000gn/T/babel-53134TSq/R-53134IWW\")")
  org-babel-R-evaluate-session("type2" = "lm(log_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+s= tate_region,data=3Dregdata,weights=3Dweight)->reg\nlm(adj_cal~sector+So= cialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+state_region,data=3Dre= gdata,weights=3Dweight)->reg.1\nlibrary(car)\nlibrary(lmtest)\nlibrary(= sandwich)\ncov1         <- vcovHC(reg, type =3D = \"HC1\")\nrobust_se    <- sqrt(diag(cov1))\n\ncov2   =       <- vcovHC(reg.1, type =3D \"HC1\")\nrobust_se2 =    <- sqrt(diag(cov2))\n           =                     =          # Adjust F statistic\nwald_results = <- waldtest(reg, vcov =3D cov1)\nwald_results2 <- waldtest(reg.1, = vcov =3D cov2)\n\n               =                     =      #coeftest(reg, vcov =3D = hccm)->reg2\noptions(scipen =3D = 999)\nlibrary(stargazer)\nstargazer(reg.1,reg,\n       =    align=3DTRUE,\n         =  title=3D\"Regression of per capita calorie intake with monthly per = capita consumer expenditure, and demographic and other socio-economic = variables\",\n          dep.var.labels =3D = c(\"Per capita calorie intake\",\"Log of per capita calorie intake\"),\n =          se=3Dlist(NULL,robust_se,robust_se2),\n =          omit=3D\"state\",\n     =      model.numbers=3DFALSE,\n         =  report =3D \"vct*\",\n         =  single.row=3DTRUE,\n          omit.labels = =3D \"State and region dummies\")" value ("replace" "scalar" "latex") = nil nil)
  org-babel-R-evaluate("type2" = "lm(log_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+s= tate_region,data=3Dregdata,weights=3Dweight)->reg\nlm(adj_cal~sector+So= cialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+state_region,data=3Dre= gdata,weights=3Dweight)->reg.1\nlibrary(car)\nlibrary(lmtest)\nlibrary(= sandwich)\ncov1         <- vcovHC(reg, type =3D = \"HC1\")\nrobust_se    <- sqrt(diag(cov1))\n\ncov2   =       <- vcovHC(reg.1, type =3D \"HC1\")\nrobust_se2 =    <- sqrt(diag(cov2))\n           =                     =          # Adjust F statistic\nwald_results = <- waldtest(reg, vcov =3D cov1)\nwald_results2 <- waldtest(reg.1, = vcov =3D cov2)\n\n               =                     =      #coeftest(reg, vcov =3D = hccm)->reg2\noptions(scipen =3D = 999)\nlibrary(stargazer)\nstargazer(reg.1,reg,\n       =    align=3DTRUE,\n         =  title=3D\"Regression of per capita calorie intake with monthly per = capita consumer expenditure, and demographic and other socio-economic = variables\",\n          dep.var.labels =3D = c(\"Per capita calorie intake\",\"Log of per capita calorie intake\"),\n =          se=3Dlist(NULL,robust_se,robust_se2),\n =          omit=3D\"state\",\n     =      model.numbers=3DFALSE,\n         =  report =3D \"vct*\",\n         =  single.row=3DTRUE,\n          omit.labels = =3D \"State and region dummies\")" value ("replace" "scalar" "latex") = nil nil)
  = org-babel-execute:R("lm(log_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+f= oodprice+log(MPCE)+state_region,data=3Dregdata,weights=3Dweight)->reg\n= lm(adj_cal~sector+SocialGroup+sex+AgeChild+AgeAdult+foodprice+log(MPCE)+st= ate_region,data=3Dregdata,weights=3Dweight)->reg.1\nlibrary(car)\nlibra= ry(lmtest)\nlibrary(sandwich)\ncov1         <- = vcovHC(reg, type =3D \"HC1\")\nrobust_se    <- = sqrt(diag(cov1))\n\ncov2         <- vcovHC(reg.1, = type =3D \"HC1\")\nrobust_se2    <- sqrt(diag(cov2))\n =                     =                    # = Adjust F statistic\nwald_results <- waldtest(reg, vcov =3D = cov1)\nwald_results2 <- waldtest(reg.1, vcov =3D cov2)\n\n   =                     =                 =  #coeftest(reg, vcov =3D hccm)->reg2\noptions(scipen =3D = 999)\nlibrary(stargazer)\nstargazer(reg.1,reg,\n       =    align=3DTRUE,\n         =  title=3D\"Regression of per capita calorie intake with monthly per = capita consumer expenditure, and demographic and other socio-economic = variables\",\n          dep.var.labels =3D = c(\"Per capita calorie intake\",\"Log of per capita calorie intake\"),\n =          se=3Dlist(NULL,robust_se,robust_se2),\n =          omit=3D\"state\",\n     =      model.numbers=3DFALSE,\n         =  report =3D \"vct*\",\n         =  single.row=3DTRUE,\n          omit.labels = =3D \"State and region dummies\")" ((:colname-names) (:rowname-names) = (:result-params "replace" "scalar" "latex") (:result-type . value) = (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb = . "no") (:tangle . "no") (:exports . "results") (:results . "replace = scalar latex") (:hlines . "no") (:session . "type2")))
  org-babel-execute-src-block(nil)
  org-babel-execute-src-block-maybe()
  org-babel-execute-maybe()
  = org-babel-execute-safely-maybe()
  = run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  org-ctrl-c-ctrl-c(nil)
  = call-interactively(org-ctrl-c-ctrl-c nil nil)
  = command-execute(org-ctrl-c-ctrl-c)



On 28-May-2016, at 10:31 pm, Charles C. Berry <ccberry@ucsd.edu> = wrote:


p.s. one more thing - below

On Sat, 28 May 2016, Charles C. Berry = wrote:

On Sat, 28 May 2016, William Denton wrote:

On 28 May = 2016, Vikas Rawal wrote:
Thanks John. Appreciate that you cared to respond to such a = vague query. I am at a loss with this one. It does not happen all the = time. I think it happens when I am processing large datasets, and CPUs = and RAM of my system are struggling to keep up. But I could be wrong.
I've had the same kind of thing happen---but C-g = (sometimes many) to kill the command, then rerunning, usually works = without any trouble. Some strange combination of CPU and RAM and all = that, the kind of thing that's not easily reproducible.

Try this: customize = `debug-on-quit' to `t' (and set for current session).

Then when you have to quit via C-g, you will get a backtrace = showing where the process was hanging and how it got there. This might = be helpful in figuring out what is going on.

Run your code and when you finally have to C-g out copy the = *Backtrace* buffer and report it back here (or on the ESS list if = appropriate).


After you copy the buffer, you should type 'q' = in the *Backtrace* buffer to finish up or you may have some odd messages = and hangups afterwards.

Chuck

= --Apple-Mail=_66381BDD-C630-4942-A1F5-182E98865ECA--