emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: Greg Tucker-Kellogg <gtuckerkellogg@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-babel R :results output changes with block level :session setting
Date: Tue, 05 Jun 2012 08:45:56 -0600	[thread overview]
Message-ID: <87d35d95qz.fsf@gmx.com> (raw)
In-Reply-To: <629FA7F0-31B5-4150-83FD-AAAA7D4C66E9@gmail.com> (Greg Tucker-Kellogg's message of "Sat, 2 Jun 2012 09:11:22 +0800")

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

Greg Tucker-Kellogg <gtuckerkellogg@gmail.com> writes:

> I'm trying to use org-mode to reproduce the HTML slide show made with
> knitr demonstrated at http://goo.gl/bOJJo .  The following single code
> block works
>
> #+BEGIN_SRC R :results output html
>   library(googleVis)
>   G <- gvisGeoChart(Exports, "Country", "Profit", options = list(width = 250, 
>       height = 120))
>   print(G)
> #+END_SRC
>
> and wraps it in the needed HTML block, but if I set :session on the
> block the "R>" prompt is included in the output. If i set a file level
> session property it works fine, but if on a single block inserts the
> prompt.  I was expecting these would behave identically.
>
> Is this the expected behavior?
>
> Greg
>

Hi Greg,

This is not expected behavior, and in fact I do not see this behavior on
my system.  I get the attached (below) results when running your code
block in a session.  Is it possible that you have customized your R
session prompt?  If so you may need to customize the R prompt regexp in
ob-R.el.  Currently this is a literal value on line 353, but if it would
be useful to customize this value I will make it a defcustom so that you
can customize it from your .emacs.

Best,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gvis.org --]
[-- Type: text/x-org, Size: 2763 bytes --]

#+BEGIN_SRC R :results output html :session
  library(googleVis)
  G <- gvisGeoChart(Exports, "Country", "Profit", options = list(width = 250, height = 120))
  print(G)
#+END_SRC

#+RESULTS:
#+BEGIN_HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>GeoChartID425d7603333b</title>
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <style type="text/css">
    body {
          color: #444444;
          font-family: Arial,Helvetica,sans-serif;
          font-size: 75%;
    }
    a {
          color: #4D87C7;
          text-decoration: none;
    }
  </style>
</head>
<body>
 <!-- GeoChart generated in R 2.15.0 by googleVis 0.2.16 package -->
<!-- Tue Jun  5 08:42:40 2012 -->


<!-- jsHeader -->
<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
<script type="text/javascript">
 
// jsData 
function gvisDataGeoChartID425d7603333b ()
{
  var data = new google.visualization.DataTable();
  var datajson =
[
 [
 "Germany",
          3 
],
[
 "Brazil",
          4 
],
[
 "United States",
          5 
],
[
 "France",
          4 
],
[
 "Hungary",
          3 
],
[
 "India",
          2 
],
[
 "Iceland",
          1 
],
[
 "Norway",
          4 
],
[
 "Spain",
          5 
],
[
 "Turkey",
          1 
] 
];
data.addColumn('string','Country');
data.addColumn('number','Profit');
data.addRows(datajson);
return(data);
}
 
// jsDrawChart
function drawChartGeoChartID425d7603333b() {
  var data = gvisDataGeoChartID425d7603333b();
  var options = {};
options["width"] =    250;
options["height"] =    120;

     var chart = new google.visualization.GeoChart(
       document.getElementById('GeoChartID425d7603333b')
     );
     chart.draw(data,options);
    

}
  
 
// jsDisplayChart 
function displayChartGeoChartID425d7603333b()
{
  google.load("visualization", "1", { packages:["geochart"] }); 
  google.setOnLoadCallback(drawChartGeoChartID425d7603333b);
}
 
// jsChart 
displayChartGeoChartID425d7603333b()
 
<!-- jsFooter -->  
//-->
</script>
 
<!-- divChart -->
  
<div id="GeoChartID425d7603333b"
  style="width: 250px; height: 120px;">
</div>
 <div><span>Data: Exports &#8226; Chart ID: <a href="Chart_GeoChartID425d7603333b.html">GeoChartID425d7603333b</a></span><br /> 
<!-- htmlFooter -->
<span> 
R version 2.15.0 (2012-03-30) &#8226; <a href="http://code.google.com/p/google-motion-charts-with-r/">googleVis-0.2.16</a>
&#8226; <a href="https://developers.google.com/terms/">Google Terms of Use</a> &#8226; <a href="https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart.html#Data_Policy">Data Policy</a>
</span></div>
</body>
</html>
#+END_HTML

[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte

      reply	other threads:[~2012-06-05 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-02  1:11 org-babel R :results output changes with block level :session setting Greg Tucker-Kellogg
2012-06-05 14:45 ` Eric Schulte [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d35d95qz.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gtuckerkellogg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).