From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1 with LMTPS id uP//KbK6jF4UJgAAk0OIDg (envelope-from ) for ; Tue, 07 Apr 2020 17:38:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SFNAC7G6jF6eQQAA1q6Kng (envelope-from ) for ; Tue, 07 Apr 2020 17:38:57 +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 aspmx1.migadu.com (Postfix) with ESMTPS id 08667950BBC for ; Tue, 7 Apr 2020 17:38:55 +0000 (UTC) Received: from localhost ([::1]:51386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLsBY-0007cV-1M for larch@yhetil.org; Tue, 07 Apr 2020 13:38:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33498) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLsAd-0007Wa-Uh for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 13:37:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLsAb-0003pe-4e for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 13:37:54 -0400 Received: from mx0a-00395d01.pphosted.com ([148.163.133.170]:4770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jLsAa-0003oj-Hf for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 13:37:53 -0400 Received: from pps.filterd (m0173170.ppops.net [127.0.0.1]) by mx0a-00395d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 037HW74Y000727; Tue, 7 Apr 2020 10:37:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=campus; bh=7dHi8yh0eTXqtBcVdxQXRFOB9pgLZ871nnR8sBjx3eE=; b=dGrdCZEBjxrmNiDrNhxcHs2NqMeaNHErtEBB73VT2zM69dhkBf5S1XpUXXdKuq85cD/M Itrek+XI7IC3Gjb7ugneoVErvut4xFubL89qa8jXcLb/6s3JzucnV5S7pSKsZ+Sk9IFb +XY5RPdax3O8/2wG2qykYGVi2hVaK8SqSD2c0Oz1iiLG/5R7iiFLBbU8qxl+bILL2xd9 TFFc2ZQjHmkFdAVUsU/+rm/3hjFAaAO7tu9fUhNxfyaoxPPF6pc3UPid9U59VG7MX2sh BxtaNxD5d0TlzYsE2RqRAOdwU3XzMDvK88qtimoC3ccUprhvFQF9xSBhS2H1hJAbHTPp vg== Received: from secdlpezp04.ucsd.edu ([40.112.251.180]) by mx0a-00395d01.pphosted.com with ESMTP id 306qum3qj0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Apr 2020 10:37:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g7w+Dk3D8hpOQ6Nk4d/I8z3aZZ9Yz2djZAAAiRc+DQjdWDew6ynT/iVyWUq/yOnXwg0fNEjAgPU+lPgn0kQru7GysHe2iORhHqg0kKkqsowjRR2ZWjkV++LtNT+ap1KqHgMpbiLD9UoSmUjx3P0egnwnMQr9bx5Lr2OblCgTyr1rpPROiQRNocGHojwaag/sDLrCGSczn1FBZnJ1lcz+TFiOaxq0n7jAwNC2RDUpukRibZRZipx/b/ReiSft/ti6JGZA1PciBVvv8hXgItri0ORuGWGz/n+/UMIrmUBTLvBzpe2+7od1rmi5mVReBsKdHI185MiLtiy8jSO0HtCG9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7dHi8yh0eTXqtBcVdxQXRFOB9pgLZ871nnR8sBjx3eE=; b=VABl5flv961BFnAQezQ3DOAYifoxWd2YVKUjBnQyg4hQPJTJaFw4B7vX+/ktsBh6JAd/CAdFKrB9qrJFVGbO2Lr6KXZPqs/zGE2ElrJiv7R/ZNs/cM8O7smenPWlXARstSwqogZl6Oo04Qpjk7snN48UTbroCnoMBkmSvo2AvNxzoPKQXtMLGzRexkVQfseHRSTK2DXs1b53juDeywe2s3pun3GODPv5pftBVHhIQ3fwSY4dfdj9BHV8PssXcTyAtxa/bslM7LUW8NxRY/aZGV+OmieYJqTZ6CwgJv6KXP6YMGuWja7BYeW0Qk6owPSzvNJj1QXRByu9YKnG3wmG0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 132.239.0.26) smtp.rcpttodomain=gnu.org smtp.mailfrom=health.ucsd.edu; dmarc=temperror action=none header.from=health.ucsd.edu; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsdcloud.onmicrosoft.com; s=selector2-ucsdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7dHi8yh0eTXqtBcVdxQXRFOB9pgLZ871nnR8sBjx3eE=; b=PnnQQAqxsvErJgBjw0plDwPvgVZouGhB1dPMs4eOFfE4RPFMwQYiyJirq+4ATHdUqTB8hDo/CYH223wad/tUjCyuCmywPFwaI7SBYuEQ3Z2J3reWNZkkmkhx2dCFnOhBUFTgnz4dip09v3eSLY3vl6ra8Je6Mll74YxMMHS3mLI= Received-SPF: TempError (protection.outlook.com: error in processing during lookup of health.ucsd.edu: DNS Timeout) To: Matt Price Subject: Re: R session and plotting in x11 window Thread-Topic: R session and plotting in x11 window Thread-Index: AQHWDQMl33XNycp2rUSWiAf5Z4uCBQ== Date: Tue, 7 Apr 2020 17:37:01 +0000 Message-ID: <81A6614A-4E28-42C4-9245-01599CB4D498@ucsd.edu> References: <44FD428E-9525-4FE4-88BC-9A906960DD4B@ucsd.edu> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.7.165.110] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:132.239.0.26; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:newmail.ucsd.edu; PTR:xmail-a1.ucsd.edu; CAT:NONE; SFTY:; SFS:(10009020)(376002)(346002)(396003)(136003)(39860400002)(46966005)(63370400001)(26005)(47076004)(70206006)(2906002)(70586007)(33656002)(6916009)(4326008)(7696005)(63350400001)(478600001)(53546011)(36756003)(7636002)(186003)(336012)(9686003)(5660300002)(75432002)(246002)(8936002)(8676002)(316002)(786003)(82740400003)(356004)(86362001); DIR:OUT; SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa139675-05b3-4ac4-3f6d-08d7db1a5d63 X-MS-TrafficTypeDiagnostic: MN2PR04MB5614: X-Microsoft-Antispam-PRVS: x-campus_o365: o365_983452 X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-Forefront-PRVS: 036614DD9C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ncxBK5T3tp7XcP5Nsm/rupRstTVPUBgkj3JnIHzyTy4Wlqk7NBcDdMoOeQ9Fcd9NXX6qxNtbF3o0uggYbMXgXTtgIuo2A0AErEPyqFzU6yhOIMW2pGnthe3zYCi/Qsv/tG59xf4f326zopmiRawKG5d9eXEI21EEFXmrz1FlwrKxiLC6VqN1GQDfy/dhY/zS5uHpNsRjAjVEluOTu/qqfpOawK4iRife8N28GFLwLm7wOiln3hQUp4LOp5wEdZha4qVV8ekU/5eGiJFsLQ3bDYm08I5tB5sz7+ibM6Q14kv3IiYHE7DjGym23k4O8oURwABib4IYarW+vhkiqxb5aw0NMjAmIFVAHu7qPKYy5dlDNbGEjKTi0tpi7gdQKf3VameEupcaLnGtotM5WaEiOy6HnnlbQOfVtCVfOjjjv2yqJSO4ONgUDP57JfYN84tKuQCExTA2uaMToi2c1EyxmQk7N8b1EB1L01YDcQubZ4lJ3d1LtTiCPeAJrQwTyxMlcleae3PichmjoeaT1EaG3g== X-OriginatorOrg: ucsd.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2020 17:37:37.7403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa139675-05b3-4ac4-3f6d-08d7db1a5d63 X-MS-Exchange-CrossTenant-Id: 8a198873-4fec-4e76-8182-ca479edbbd60 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=8a198873-4fec-4e76-8182-ca479edbbd60; Ip=[132.239.0.26]; Helo=[newmail.ucsd.edu] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5614 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-07_08:2020-04-07, 2020-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=622 bulkscore=0 adultscore=0 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004070143 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 148.163.133.170 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: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" Reply-to: "Berry, Charles" From: "Berry, Charles" via "General discussions about Org-mode." ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=default; t=1586281136; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=7dHi8yh0eTXqtBcVdxQXRFOB9pgLZ871nnR8sBjx3eE=; b=FdAgLppQ9zObvN0LEVkw83+UJdNj6MKeFHDj6xpvAHnfOabkzY/ie6haZBvo71ZKu50NDX W+zaBLoZoetvykUiVLbGV/9Ip/iEqt/R2V5PMhLQOkoTf5VIMGLHkSBgAhY1wpWVt0CMTd +PLrNvrTcKtBYpAZkmcqPRpC2YPEhUM= ARC-Seal: i=2; s=default; d=yhetil.org; t=1586281136; a=rsa-sha256; cv=fail; b=Spz7qzx9W3XETZSiGuN1Ajm7PZfIkV12jelBLEz+nD4VgqB1uB5vMx+eNuK+j3hefAv5YW uPk1Sod/vIOtbqosdwdTjDqKSB180KZYfS7I3xy02oCc+TNcSkLVA4Nhqk7CgM3lO0O4bZ VuEmpLM7sh5FRuDXv/Rr2QEhy5LTwYg= ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=ucsd.edu header.s=campus header.b=dGrdCZEB; dkim=fail (rsa verify failed) header.d=ucsdcloud.onmicrosoft.com header.s=selector2-ucsdcloud-onmicrosoft-com header.b=PnnQQAqx; arc=reject (signature check failed: fail, {[1] = sig:microsoft.com:reject}); spf=pass (aspmx1.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: 1.99 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=ucsd.edu header.s=campus header.b=dGrdCZEB; dkim=fail (rsa verify failed) header.d=ucsdcloud.onmicrosoft.com header.s=selector2-ucsdcloud-onmicrosoft-com header.b=PnnQQAqx; dmarc=none; spf=pass (aspmx1.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 [1.99 / 13.00]; HAS_REPLYTO(0.00)[ccberry@health.ucsd.edu]; GENERIC_REPUTATION(0.00)[-0.58245868194477]; HAS_XOIP(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.32), country: US(-0.01), ip: 209.51.188.17(-0.58)]; R_DKIM_REJECT(1.00)[ucsd.edu:s=campus,ucsdcloud.onmicrosoft.com:s=selector2-ucsdcloud-onmicrosoft-com]; ARC_SIGNED(0.00)[i=2]; ARC_REJECT(2.00)[signature check failed: fail, {[1] = sig:microsoft.com:reject}]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[ucsd.edu:-,ucsdcloud.onmicrosoft.com:-]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; 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)[emacs-orgmode@gnu.org,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: FCOGAltIXglP Matt, I am glad you got past your roadblock. I am puzzled by your use of `dev.set'. I have never explicitly invoked that= function.=20 FWIW, I have used R for more than 20 years and routinely write packages or = reports that create graphics. And I use ESS (and used its predecessor S-mode) as my principal IDE for tha= t work. (Org relies on ESS for modes relating to R.) I routinely use Mac OS= , but occasionally work with Linux and Windows. Invoking R from the terminal window (or equivalent on Windows) and typing i= nteractive commands, I get: > dev.cur() null device=20 1=20 > plot(1:5) > dev.cur() quartz=20 2=20 >=20 Note there is no call to dev.set().=20 The quartz device (the interactive default on Mac OS) is invoked implicitly= by plot as described by the `Details' in the help page displayed by typing= `?device' as the R prompt" "If no device is open, calling any high-level graphics function will cause = a device to be opened." If I start emacs and open an org buffer with just this src block in it: #+begin_src R dev.cur() plot(1:5) dev.cur() #+end_src then place point in the src block and type the line in this example block #+begin_example C-c ' C-n RET C-n C-n #+end_example I end up with the same output as above in my *R* session buffer. A new grap= hics device is opened and the plot appears in it. Best, Chuck > On Apr 6, 2020, at 6:26 PM, Matt Price wrote: >=20 >=20 >=20 > On Sun, Apr 5, 2020 at 1:19 PM Berry, Charles w= rote: >=20 >=20 > > On Apr 4, 2020, at 4:27 PM, Matt Price wrote: > >=20 > > 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? >=20 >=20 > Short answer: almost none. >=20 > Long answer: what `org-babel-R-initite-session' and friends do. > :-) thanks, I should have been looking for that=20 >=20 > >=20 > > I'm just learning R and my usual method for learning a language is to k= eep a kind of notebook in org with code snippets they I can execute and ite= rate 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. =20 > >=20 > > 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 ha= ve it pop open the window... But that doesn't seem to work. Anyone know if = I can tweak something to make that possible? > >=20 >=20 >=20 > I sam really puzzled by this. Do you have an ECM that illustrates this? >=20 > 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). >=20 > If I had to guess, I'd say that you are opening an R session, but not usi= ng 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. >=20 > 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 an= d after you create a plot and see what the result is. >=20 > This was the problem. I don't see that I'm calling dev.set() anywhere but= when the session initiates dev.cur() returns >=20 > null > 1 >=20 > calling dev.set(1) or dev.set(2) launches an R_x11 window and future plot= s are displayed there. As I say, I'm just learning R, and I don't really u= nderstand 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. Mo= st references to "device" in ~ob-R.el~ seem to be managing file outputs, an= d "X11". For now I don't think I'll explore a proper solution as I'm alrea= dy pretty far down a rabit hole just learning R at all! But thanks very mu= ch for this workaround.=20 >=20 > Matt > HTH, >=20 > Chuck