From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: was this intentional with the default header ":results value" Date: Sat, 14 Jul 2012 06:44:15 -1000 Message-ID: References: <87pq7zhh75.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sq5SD-0008Cs-IE for emacs-orgmode@gnu.org; Sat, 14 Jul 2012 12:44:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sq5SC-0001vu-Ct for emacs-orgmode@gnu.org; Sat, 14 Jul 2012 12:44:25 -0400 Received: from oproxy1-pub.bluehost.com ([66.147.249.253]:36835) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Sq5SC-0001vp-2K for emacs-orgmode@gnu.org; Sat, 14 Jul 2012 12:44:24 -0400 In-Reply-To: <87pq7zhh75.fsf@gmail.com> (Eric Luo's message of "Fri, 13 Jul 2012 22:24:46 +0800") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Luo Cc: emacs-orgmode@gnu.org Aloha Eric, Eric Luo writes: > Hi,=20 > Why in the following code block, c1 was printed as scientific notation > rather then characters. > ,---- > |=20 > | #+BEGIN_SRC R :results value > | df <- data.frame(c1=3D"123456789123456789",c2=3D2) > | #+END_SRC > |=20 > | #+RESULTS: > | | 1.2345678912345678e+17 | 2 | > `---- With :results value the results are passed from the source language into emacs-lisp and then displayed in the buffer. So, the representation of things like very large numbers depends on how that was done in emacs-lisp, independent of the source language conventions. In this case, I suspect the number was written with a formatting string and =E2=80= =98%g=E2=80=99 which uses scientific notation if that is a shorter representation. > But if the header :results output, the result was expected. > ,---- > |=20 > | #+BEGIN_SRC R :results output=20 > | df <- data.frame(c1=3D"123456789123456789",c2=3D2) > | df > | #+END_SRC > |=20 > | #+RESULTS: > | : c1 c2 > | : 1 123456789123456789 2 > `---- > With :results output the results aren't translated into emacs-lisp. Instead, the output from the source language is collected and displayed in the buffer. Thus, the output conventions of the source language are respected.=20 hth, Tom --=20 Thomas S. Dye http://www.tsdye.com