From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1 with LMTPS id yPivB/1ljF5qPQAAk0OIDg (envelope-from ) for ; Tue, 07 Apr 2020 11:37:33 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0Dn2IvtljF7+UAAAB5/wlQ (envelope-from ) for ; Tue, 07 Apr 2020 11:37:31 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx2.migadu.com (Postfix) with ESMTPS id 708D168E054 for ; Tue, 7 Apr 2020 11:37:29 +0000 (UTC) Received: from localhost ([::1]:45690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLmXo-0007XM-IN for larch@yhetil.org; Tue, 07 Apr 2020 07:37:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53342) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLmXH-0007X7-BL for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 07:36:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLmXF-0001qg-Lo for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 07:36:55 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:52192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jLmXF-0001pe-EV for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 07:36:53 -0400 Received: by mail-wm1-x333.google.com with SMTP id z7so1392814wmk.1 for ; Tue, 07 Apr 2020 04:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T6uXT1IZKz6Tz+pEL/lUeKF37GuNu81WUEShY1uH/lI=; b=CRF/P1TvOlXKSq51qS2kqlioS4y9VNkoYGnk/iG6skFR3SzuHde3xEHnYRU0m2QjOO 0vCfaw0Ruz4QOI46uXiYrpluRmVILgWFzOVk8xTweIfZAAgrIWXJ98UkritFDX69ivU3 pE38qFtl28MIvZEWI8AudU4f4gcETB6ks8pBGfvqkleGXIfWmIytm8YohWvDLMIZn4a2 6K5ZRH/YsX/8X9RjCF8YYVM9VE0XowoBw4nQmcZNHKnVWMCQQFQpVwGUCsRg8F0Qj+76 xGMYFtcKCq1iEiwXGB2iBy9vhG933ZLN5x+un/k4ZGmvtERQY+N3BeZORbdaZGQHPIf/ 0M7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T6uXT1IZKz6Tz+pEL/lUeKF37GuNu81WUEShY1uH/lI=; b=XmFgNIZ924qKnvNBEbhRBgxdC5ibft4/ONv0vIYR3H4PSX3gt2My3LOwSW/Jr/o4n9 0MAPvLjuHSqqw2WvjtkWUlzTkkiXtMD840vecMnsMcRnTwS+JJT2EfHRIGlAIKN2LPx4 EFwKvT9+TREBy2P4KJWsqAqhQbY+/zHmF00oQ4+9CFSKBOPH8oF5oT/ha8bmwEmq8kFc JTmDlnEo72Ui6vvdiRZNfLaAJK+a244rtnz/ISqazIh4nFMUjeh6yP26gCs2GyUlDRNb 3/Uyf93PJtKcYZ7uXBTXAL2iNCak1n846ak86veox8sNh4Xm+VFQSVDPza5ArZQiRrSA 2LQQ== X-Gm-Message-State: AGi0PubSmcWOyEYk0TB4ts74MBgNdXfEwHC3OX026/QXYEcRGwaLKOpf JzJhNKuwHDPowwtz1HH4ZCE7m7sHOShahgWPrRM= X-Google-Smtp-Source: APiQypJ8MXJ9DunYKYj5yv4gv4VwZbocsBGxAPAPO882dbHwoDDNt1NoS3kk8LwWLfnN61AeF0PfXokO/qYCmsl62og= X-Received: by 2002:a7b:c8cd:: with SMTP id f13mr1987918wml.138.1586259411796; Tue, 07 Apr 2020 04:36:51 -0700 (PDT) MIME-Version: 1.0 References: <44FD428E-9525-4FE4-88BC-9A906960DD4B@ucsd.edu> In-Reply-To: From: "briangpowell ." Date: Tue, 7 Apr 2020 07:36:40 -0400 Message-ID: Subject: Re: R session and plotting in x11 window To: Matt Price Content-Type: multipart/alternative; boundary="000000000000c3067e05a2b1ccc9" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Berry, Charles" , Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=default; t=1586259450; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=T6uXT1IZKz6Tz+pEL/lUeKF37GuNu81WUEShY1uH/lI=; b=YXg6YE4qewlic7aBCyW1PbzdagGYAKEUVnoU+RC6pBx9MZ0u5JGKkkGT++/cEqC2AlPHZX EH/Srlg1e/dJdV/wQxs2mGaetpbresY2nRw9aueTO9Ie1+vvW/93G+cMXU5lkOT/v9LGkF cIC8ROjbpHItUfGriISZ8QjEreenFg4= ARC-Seal: i=1; s=default; d=yhetil.org; t=1586259450; a=rsa-sha256; cv=none; b=ae4pTKBeg7NEqjQFfMt7GaTF4+T389gifyhopOkqH86WTKbr47SQZif+QaOB7KaxLMKXSo G57l9qw0Kjy0yzodq1cHsrTBrqOSIJ4Tjhi3SJiqAT0VudosIy+aH9e4ImJjnvjCZshX9k pc0/T113jJXlo8qF7FZjsWBD9BfDDcM= ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=CRF/P1Tv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx2.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scanner: scn0 X-Spam-Score: -0.71 Authentication-Results: aspmx2.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=CRF/P1Tv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx2.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-0.71 / 13.00]; GENERIC_REPUTATION(0.00)[-0.58256720155364]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.32), country: US(-0.01), ip: 209.51.188.17(-0.58)]; ARC_SIGNED(0.00)[i=1]; URI_COUNT_ODD(1.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[briangpowellms@gmail.com,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: IXKut9J5DNl3 --000000000000c3067e05a2b1ccc9 Content-Type: text/plain; charset="UTF-8" "I also don't understand why it would be set to X11 in a plain-old R session" R is an open source derivative of S and S-PLUS--"S" was the "Statistics Language" MIT X Consortium's "X Motif" is the default output of R from its inception R, S, S-PLUS have always made such output as its default Suggest you just "get with the program"--thousands of R libraries are ready for you to use, extend and create your own libraries if you like--all leveraging the power of X11R6 --i.e. the XWindows system: https://en.wikipedia.org/wiki/X_Window_System By the way Micro$oft Windows is based on MIT's W--W stood for Windows--yet another thing MicroSoft swiped and monopolized and then sued others about whenever possible--rather than join the open source & free software movement X11 is free & open source--all the best software is free & open source--like Emacs Org-Mode On Mon, Apr 6, 2020 at 9:27 PM Matt Price wrote: > > > On Sun, Apr 5, 2020 at 1:19 PM Berry, Charles > wrote: > >> >> >> > On Apr 4, 2020, at 4:27 PM, Matt Price wrote: >> > >> > Does anyone know much about the difference between an R session opened >> by typing M-x R, and the R session opened by org-babel? >> >> >> Short answer: almost none. >> >> Long answer: what `org-babel-R-initite-session' and friends do. >> > :-) thanks, I should have been looking for that > >> >> > >> > I'm just learning R and my usual method for learning a language is to >> keep a kind of notebook in org with code snippets they I can execute and >> iterate on rapidly as I learn. This works great in R when I'm just doing >> math. When I am working on plots, it would be nice to have them open up >> quickly either in emacs or in the standard x11 window that R session opened >> switch M-x R opens up. >> > >> > I know I can set the src block headers to produ e a file, but when I'm >> just iterating rapidly I often switch back and forth between a data output >> and a graphical output, and typing/erasing those headers is clunky and >> slow. It would be easier to just paste the plot command into the console >> and have it pop open the window... But that doesn't seem to work. Anyone >> know if I can tweak something to make that possible? >> > >> >> >> I sam really puzzled by this. Do you have an ECM that illustrates this? >> >> Working interactively on my Mac (Quartz - X11 is the device), I routinely >> do what you describe - usually working from the src edit buffer - and the >> plots are displayed (and older plots are available via clover-left or some >> such). >> >> If I had to guess, I'd say that you are opening an R session, but not >> using it. If you execute a src block, but it does not have a `:session' >> header, a new instance of R will create a plot file and then exit. If you >> look in the default directory, you would see `Rplots.pdf' or some such. >> >> The only other thing that comes to mind is that you opened a device that >> is holding on to all your plots. Try `dev.cur()' in R immediately before >> and after you create a plot and see what the result is. >> >> This was the problem. I don't see that I'm calling dev.set() anywhere but > when the session initiates dev.cur() returns > > null > 1 > > calling dev.set(1) or dev.set(2) launches an R_x11 window and future plots > are displayed there. As I say, I'm just learning R, and I don't really > understand how the device is set up. I also don't understand why it would > be set to X11 in a plain-old R session, but not in an org-babel R session. > Most references to "device" in ~ob-R.el~ seem to be managing file outputs, > and "X11". For now I don't think I'll explore a proper solution as I'm > already pretty far down a rabit hole just learning R at all! But thanks > very much for this workaround. > > Matt > >> HTH, >> >> Chuck >> >> >> --000000000000c3067e05a2b1ccc9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
"I also don't understand why it = would be set to X11 in a plain-old R session"

R is an open source derivative of S and S-PLUS--"S" was the &quo= t;Statistics Language"

MIT X Consortium&#= 39;s "X Motif" is the default output of R from its inception
<= /div>

R, S, S-PLUS have always made such output as its d= efault

Suggest you just "get with the pro= gram"--thousands of R libraries are ready for you to use, extend and c= reate your own libraries if you like--all leveraging the power of X11R6 --i= .e. the XWindows system: https://en.wikipedia.org/wiki/X_Window_System

By the way Micro$oft Windows is based on MIT's W--W stood for W= indows--yet another thing MicroSoft swiped and monopolized and then sued ot= hers about whenever possible--rather than join the open source & free s= oftware movement

X11 is free & open source--al= l the best software is free & open source--like Emacs Org-Mode



On Mon, Apr 6, 2020 at 9:27 PM Matt Pri= ce <moptop99@gmail.com> wro= te:


On Sun, Apr 5, 2020 at 1:19 PM = Berry, Charles <ccberry@health.ucsd.edu> wrote:


> On Apr 4, 2020, at 4:27 PM, Matt Price <moptop99@gmail.com> = wrote:
>
> Does anyone know much about the difference between an R session opened= by typing M-x R, and the R session opened by org-babel?


Short answer: almost none.

Long answer: what `org-babel-R-initite-session' and friends do.
:-) thanks, I should have been looking for that

>
> I'm just learning R and my usual method for learning a language is= to keep a kind of notebook in org with code snippets they I can execute an= d iterate on rapidly as I learn. This works great in R when I'm just do= ing math.=C2=A0 When I am working on plots, it would be nice to have them o= pen up quickly either in emacs or in the standard x11 window that R session= opened switch M-x R opens up.=C2=A0
>
> I know I can set the src block headers to produ e a file, but when I&#= 39;m just iterating rapidly I often switch back and forth between a data ou= tput and a graphical output, and typing/erasing those headers is clunky and= slow. It would be easier to just paste the plot command into the console a= nd have it pop open the window... But that doesn't seem to work. Anyone= know if I can tweak something to make that possible?
>


I sam really puzzled by this. Do you have an ECM that illustrates this?

Working interactively on my Mac (Quartz - X11 is the device), I routinely d= o what you describe - usually working from the src edit buffer - and the pl= ots are displayed (and older plots are available via clover-left or some su= ch).

If I had to guess, I'd say that you are opening an R session, but not u= sing it. If you execute a src block, but it does not have a `:session' = header, a new instance of R will create a plot file and then exit. If you l= ook in the default directory, you would see `Rplots.pdf' or some such.<= br>
The only other thing that comes to mind is that you opened a device that is= holding on to all your plots. Try `dev.cur()' in R immediately before = and after you create a plot and see what the result is.

This was the problem. I don't see that I'm ca= lling dev.set() anywhere but when the session initiates dev.cur() returns

null
=C2=A0=C2=A0=C2=A0=C2=A0 1
=

calling dev.set(1) or dev.set(2) launches an R_x11 wind= ow and future plots are displayed there.=C2=A0 As I say, I'm just learn= ing R, and I don't really understand how the device is set up. I also d= on't understand why it would be set to X11 in a plain-old R session, bu= t not in an org-babel R session. Most references to "device" in ~= ob-R.el~ seem to be managing file outputs, and "X11". For now I d= on't think I'll explore=C2=A0 a proper solution as I'm already = pretty far down a rabit hole just learning R at all!=C2=A0 But thanks very = much for this workaround.

Matt
HTH,

Chuck


--000000000000c3067e05a2b1ccc9--