Revision: 749
          http://rpy.svn.sourceforge.net/rpy/?rev=749&view=rev
Author:   lgautier
Date:     2009-08-15 19:20:59 +0000 (Sat, 15 Aug 2009)

Log Message:
-----------
moved some more pages to the new templating system

Modified Paths:
--------------
    trunk/htdocs/build.py
    trunk/htdocs/templates/base.html

Added Paths:
-----------
    trunk/htdocs/templates/contacts.html
    trunk/htdocs/templates/maillist.html
    trunk/htdocs/templates/rpy.html
    trunk/htdocs/templates/rpy_bugs.html
    trunk/htdocs/templates/rpy_demo.html
    trunk/htdocs/templates/rpy_download.html

Removed Paths:
-------------
    trunk/htdocs/bugs.data
    trunk/htdocs/contacts.data
    trunk/htdocs/download.data
    trunk/htdocs/maillist.data
    trunk/htdocs/rpy.data
    trunk/htdocs/rpy_demo.data

Deleted: trunk/htdocs/bugs.data
===================================================================
--- trunk/htdocs/bugs.data      2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/bugs.data      2009-08-15 19:20:59 UTC (rev 749)
@@ -1,18 +0,0 @@
-<!-- page-title: RPy bugs -->
-<!-- title: Bugs -->
-
-  <p> Please report any bugs that you encounter using the SourceForge
-  bug tracking system.
-  </p>
-
-  <center>
-    <font size=+2>
-      <a href="http://sourceforge.net/tracker/?group_id=48422&atid=453021";>
-       RPy BUGS Page
-      </a>
-    </font>
-  </center>
-
-  <p>
-    This page also provides a list of currently active bugs:
-  </p>

Modified: trunk/htdocs/build.py
===================================================================
--- trunk/htdocs/build.py       2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/build.py       2009-08-15 19:20:59 UTC (rev 749)
@@ -1,9 +1,16 @@
 from jinja2 import Environment, FileSystemLoader
 
 to_render = ('index.html',
+             'contacts.html',
+             'maillist.html',
+             'rpy.html',
+             'rpy_bugs.html',
+             'rpy_demo.html',
+             'rpy_download.html',
+             'rpy2_bugs.html'
+             'rpy2_download.html',
              'rpy2.html',
-             'rpy2_download.html',
-             'rpy2_bugs.html')
+             )
 
 newsfile = file("news.data")
 newsdata = []

Deleted: trunk/htdocs/contacts.data
===================================================================
--- trunk/htdocs/contacts.data  2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/contacts.data  2009-08-15 19:20:59 UTC (rev 749)
@@ -1,63 +0,0 @@
-<!-- page-title: RPy: contacts -->
-<!-- title: Contacts -->
-
-
-  <p>
-    Before contacting the authors, please try the
-    <a href="http://rpy.sourceforge.net/maillist.html";>Rpy-talk Mailing 
List</a>.       (We do have
-    day jobs!)
-  </p>
-  <table border="0" cellpadding="0" cellspacing="0" width="100%">
-  <colgroup>
-    <col width="60"><col>
-  </colgroup>
-
-  <tbody>
-  <tr>
-  <td colspan="2"><h3>rpy</h3></a>
-  </tr>
-  <tr>
-  <td valign="top">
-    <img src="graphics/email.png" alt="mailbox">
-  </td>
-
-  <td valign="middle"> Walter Moreira.
-    <br>  Personal page: 
-    <a href="http://www.waltermoreira.net/";>
-      <span>www.waltermoreira.net</span>
-    </a>
-    <br><br><br>
-  </td>
-  </tr>
-
-  <tr>
-  <td valign="top">
-    <img src="graphics/email.png" alt="mailbox">
-  </td>
-
-  <td valign="middle"> Gregory R. Warnes
-    <br>
-    Personal page: <a href="http://www.warnes.net/";>www.warnes.net</a>
-    <br><br>
-  </td>
-
-  </tr>
-
-  <tr>
-  <td colspan="2"><h3>rpy2</h3></a>
-  </tr>
-  <tr>
-  <td valign="top">
-    <img src="graphics/email.png" alt="mailbox">
-  </td>
-
-  <td valign="middle"> Laurent Gautier
-    <br>
-    Personal email: <i>lgautier at gmail.com</i>
-    <br><br>
-  </td>
-  
-  </tr>
-
-
-  </tbody></table>

Deleted: trunk/htdocs/download.data
===================================================================
--- trunk/htdocs/download.data  2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/download.data  2009-08-15 19:20:59 UTC (rev 749)
@@ -1,72 +0,0 @@
-<!-- page-title: Download RPy -->
-<!-- title: Download -->
-
-  <p>
-    You can download RPy from the 
-    <a href="http://sourceforge.net/project/showfiles.php?group_id=48422";>
-       RPy Sourceforge downloads page
-    </a>.
-  </p>
-  <p>
-    For <i>rpy2</i>, check the <a href="rpy2.html">rpy2 page</a>
-  </p>
-
-    <h3>Installation</h3>
-
-    <p>
-      For installation instructions, please see the <a
-      href="rpy/README">README</a> file (this file is also included in
-      the source distribution).
-    </p>
-
-  <p>
-    For some systems, you may need to do some minor libraries arrangement,
-    check the <a href="faq.html">FAQ</a>.
-  </p>
-
-  <h3>Notes for Window users:</h3>
-
-  On Windows, you must install the following Python extensions
-  in order to use RPy:
-  <ul>
-    <li>
-        <a 
href="http://starship.python.net/crew/mhammond/win32/Downloads.html";>
-            Mark Hammond's Python extensions
-        </a> 
-          (Conveniently included as part of
-          <a href="http://www.activestate.com/Products/ActivePython/";>
-            ActiveState Python
-        </a>)
-    </li>
-
-
-   <li> "NumPy" python module: 
-        <a href="http://numpy.sf.net/";>Main page</a>
-       <a 
href="http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103";>
-          Downloads</a> 
-        <b>Note that you need the <code>NumPy</code> module and
-        <it>not</it> <code>Numeric</code></b>
-   </li>
- 
-  </ul>
-
-
-   You must use an Rpy binary that corresponds to the version of R,
-   and Python you have installed. For example,
-   <code>rpy-<b>0.4.6</b>-R-<b>2.0.0-to-2.2.1</b>-py<b>24</b>.win32.exe</code> 
is for
-   <ul>
-     <li> RPy version <b>0.4.6</b> </li>
-     <li> R versions <b>2.0.0 through 2.2.1</b> </li>
-        <li> Python version <b>2.4</b> </Li>
-   </ul>
-
-  <h3>Developers</h3>
-
-  <p>
-    The development version of RPy can be accessed via CVS in the
-    Sourceforge <a
-    href="http://sourceforge.net/svn/?group_id=48422";>repository</a>.
-    Be careful because the CVS version may be
-    unstable.
-  </p>
-

Deleted: trunk/htdocs/maillist.data
===================================================================
--- trunk/htdocs/maillist.data  2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/maillist.data  2009-08-15 19:20:59 UTC (rev 749)
@@ -1,23 +0,0 @@
-<!-- page-title: RPy mailing list -->
-<!-- title: Mailing List -->
-
-  <p> 
-    The rpy-talk mailing list provides an open forum for discussion
-    and annoucements.
-  </p>
-
-  <ul>
-    <li>
-      <a href="https://lists.sourceforge.net/lists/listinfo/rpy-list";>
-       Subscribe/Unsubscribe/Preferences
-      </a>
-    </li>
-
-    <li>
-      <a 
href="http://sourceforge.net/mailarchive/forum.php?forum_name=rpy-list";>
-       List Archives
-      </a>
-    </li>
-  </center>
-
-

Deleted: trunk/htdocs/rpy.data
===================================================================
--- trunk/htdocs/rpy.data       2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/rpy.data       2009-08-15 19:20:59 UTC (rev 749)
@@ -1,60 +0,0 @@
-<!-- page-title: RPy home page -->
-<!-- title: About -->
-
-
-  <p>
-    <strong>RPy</strong> is a very simple, yet robust, <a 
href="http://www.python.org/";>Python</a> interface to 
-    the <a href="http://www.r-project.org/";>R Programming Language</a>.        
 It can
-    manage all kinds of R objects and can execute arbitrary R functions
-    (including the graphic functions). All errors from the R language
-    are converted to Python exceptions.         Any module installed for the
-    R system can be used from within Python.
-  </p>
-
-  <p>
-    This code is inspired by <a 
href="http://www.omegahat.org/RSPython";>RSPython</a> from 
-    the <a href="http://www.omegahat.org/";>Omegahat project</a>. The main 
goals of
-    RPy are:
-  </p>
-
-  <ul>
-    <li> to have a <strong>very robust</strong> interface for using
-                       R <strong>from</strong> Python
-    </li>
-
-    <li> the interface should be as transparent and easy to use as
-                       possible
-    </li>
-
-    <li> it should be usable for real scientific and statistical
-                       computations
-    </li>
-  </ul>
-
-  <p>
-    Tim Churches wrote a <a 
href="http://rpy.sourceforge.net/rpy_demo.html";>demo</a>,
-    which illustrates the use of RPy.
-  </p>
-
-  <h4>Call for contributions</h4>
-
-  <p>
-    I appreciate all your feedback. If you have use RPy on a real
-    world project or if you have an interesting example or demo,
-    please, drop me a line. I'd like to collect some info, in this
-    pages, about real examples, to show the Python and R joint
-    capabilities. I hope that it will motivate many people in the
-    scientific and statistics world to use Python.
-  </p>
-
-
-  <p>
-    A tentative rewrite of RPy is being done, building on some of what
-    is existing but also redesigning a significant part. If you have wishes
-    to express, or will to participate, the moment is 
-    <a href="contacts.html">now</a>.
-  </p>
-
-  </div>
-    
-</td>
\ No newline at end of file

Deleted: trunk/htdocs/rpy_demo.data
===================================================================
--- trunk/htdocs/rpy_demo.data  2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/rpy_demo.data  2009-08-15 19:20:59 UTC (rev 749)
@@ -1,153 +0,0 @@
-<!-- page-title: RPy home page -->
-<!-- title: A Demonstration of RPy:  <a 
href="mailto:tc...@optushome.com.au";>Tim Churches</a>
--->
-<p><b><a href="http://rpy.sourceforge.net/";>RPy</a></b>, written by Walter 
Moreira and maintained by Gregory Warnes, is a Python extension module for 
using the 
-<a href="http://www.r-project.org";>R programming environment for data analysis 
and graphics</a> from within <a href="http://www.python.org";>Python</a>.
-<p><b><a href="http://rpy.sourceforge.net/";>RPy</a></b> is available from the 
<a href="http://rpy.sourceforge.net/";>RPy project web page</a>.
-As Walter notes, RPy was inspired by <a 
href="http://www.omegahat.org/RSPython/index.html";>RSPython</a> by Duncan 
Temple Lang. RSPython
-allows R to be called from Python <b>and</b> vice-versa (i.e. Python can be 
embedded in R), as well as providing more general facilities for 
-exploiting the object-oriented aspects of both Python and R. However, at least 
for me, RPy is a lot easier to use. It is my sincere hope that
-RPy and RSPython can be merged in a display of el Norte/el Sur co-operation, 
so we can have the best of both.  
-
-<p>The following example provides a small taste of both the power of the R 
environment and the ease with which RPy allows this power to be used from 
within Python.
-<p>The data are eruption times for the Old Faithful geyser which, along with 
Yogi Bear, is located in the Yellowstone National Park in Wyoming, USA.
-The data file <a href="faithful.dat">faithful.dat</a> was exported from the 
faithful example dataset which comes as part of R. The R code in this
-example was borrowed directly from Section 8.2 of "<a 
href="http://cran.r-project.org/manuals.html";>An Introduction to R, Version 
1.4.1</a>" by W.N. Venables, D.M. Smith and the R Development Core Team.
-Minimal changes to the orginal R code were required to make it work from 
within Python, thanks to RPy.
-
-<p>The following Python code (<a href="faithful.py">faithful.py</a>):
-<table>
-<tr>
-<td>
-<pre class="rcode">
-from rpy import *
-
-faithful_data = {"eruption_duration":[],
-                 "waiting_time":[]}
-                
-f = open('faithful.dat','r')
-
-for row in f.readlines()[1:]: # skip the column header line
-    splitrow = row[:-1].split(" ")
-    faithful_data["eruption_duration"].append(float(splitrow[0]))
-    faithful_data["waiting_time"].append(int(splitrow[1]))
-
-f.close()
-
-ed = faithful_data["eruption_duration"] 
-edsummary = r.summary(ed)
-print "Summary of Old Faithful eruption duration data"
-for k in edsummary.keys():
-    print k + ": %.3f" % edsummary[k]
-print    
-print "Stem-and-leaf plot of Old Faithful eruption duration data"
-print r.stem(ed)
-
-r.png('faithful_histogram.png',width=733,height=550)
-r.hist(ed,r.seq(1.6, 5.2, 0.2), prob=1,col="lightgreen",
-       main="Old Faithful eruptions",xlab="Eruption duration (seconds)")
-r.lines(r.density(ed,bw=0.1),col="orange")
-r.rug(ed)
-r.dev_off()
-
-long_ed = filter(lambda x: x > 3, ed)
-r.png('faithful_ecdf.png',width=733,height=550)
-r.library('stepfun')
-r.plot(r.ecdf(long_ed), do_points=0, verticals=1, col="blue",
-       main=paste("Empirical cumulative distribution function",
-                  " of Old Faithful eruptions longer than 3 seconds")
-x = r.seq(3,5.4,0.01)
-r.lines(r.seq(3,5.4,0.01),r.pnorm(r.seq(3,5.4,0.01),mean=r.mean(long_ed), 
-        sd=r.sqrt(r.var(long_ed))), lty=3, lwd=2, col="red")
-r.dev_off()
-
-r.png('faithful_qq.png',width=733,height=550)
-r.par(pty="s")
-r.qqnorm(long_ed,col="blue")
-r.qqline(long_ed,col="red")
-r.dev_off()
-
-r.library('ctest')
-print
-print("Shapiro-Wilks normality test of Old Faithful eruptions" +\
-      " longer than 3 seconds")
-sw = r.shapiro_test(long_ed)
-print "W = %.4f" % sw['statistic']['W']
-print "p-value = %.5f" % sw['p.value']
-
-print
-print("One-sample Kolmogorov-Smirnov test of Old Faithful eruptions" +\
-      " longer than 3 seconds"
-ks = r.ks_test(long_ed,"pnorm", mean=r.mean(long_ed), 
-               sd=r.sqrt(r.var(long_ed)))
-print "D = %.4f" % ks['statistic']['D']
-print "p-value = %.4f" % ks['p.value']
-print "Alternative hypothesis: %s" % ks['alternative']
-print
-</pre>
-</td>
-</tr>
-</table>
-
-<p>produces the following output:
-
-<table>
-<tr>
-<td>
-
-<pre class="rcode">
-Summary of Old Faithful eruption duration data
-Mean: 3.488
-Median: 4.000
-3rd Qu.: 4.454
-1st Qu.: 2.163
-Min.: 1.600
-Max.: 5.100
-
-Stem-and-leaf plot of Old Faithful eruption duration data
-
-  The decimal point is 1 digit(s) to the left of the |
-
-  16 | 070355555588
-  18 | 000022233333335577777777888822335777888
-  20 | 00002223378800035778
-  22 | 0002335578023578
-  24 | 00228
-  26 | 23
-  28 | 080
-  30 | 7
-  32 | 2337
-  34 | 250077
-  36 | 0000823577
-  38 | 2333335582225577
-  40 | 0000003357788888002233555577778
-  42 | 03335555778800233333555577778
-  44 | 02222335557780000000023333357778888
-  46 | 0000233357700000023578
-  48 | 00000022335800333
-  50 | 0370
-
-None
-
-Shapiro-Wilks normality test of Old Faithful eruptions longer than 3 seconds
-W = 0.9793
-p-value = 0.01052
-
-One-sample Kolmogorov-Smirnov test of Old Faithful eruptions longer than 3 
seconds
-D = 0.0661
-p-value = 0.4284
-Alternative hypothesis: two.sided
-</pre>
-</td>
-</tr>
-</table>
-
-<p>and these graphs:
-
-<p><img src='demo/faithful_histogram.png'>
-<p><img src='demo/faithful_ecdf.png'>
-<p><img src='demo/faithful_qq.png'>
-
-<p>Impressed? I was.
-<p>Cheers,<br><br><a href="mailto:tc...@optushome.com.au";>Tim Churches</a>
-

Modified: trunk/htdocs/templates/base.html
===================================================================
--- trunk/htdocs/templates/base.html    2009-08-15 18:25:04 UTC (rev 748)
+++ trunk/htdocs/templates/base.html    2009-08-15 19:20:59 UTC (rev 749)
@@ -47,9 +47,9 @@
   <b>rpy</b>
   <ul class="menu">
     <li><a href="rpy.html">About</a></li>
-    <li><a href="bugs.html">Bugs</a></li>
+    <li><a href="rpy_bugs.html">Bugs</a></li>
     <li><a href="svn.html">Code repository</a></li>
-    <li><a href="download.html">Download</a></li>
+    <li><a href="rpy_download.html">Download</a></li>
     <li><a href="documentation.html">Documentation</a></li>
     <li><a href="rpy_demo.html">Demo</a></li>
     <li><a href="faq.html">FAQ</a></li>

Added: trunk/htdocs/templates/contacts.html
===================================================================
--- trunk/htdocs/templates/contacts.html                                (rev 0)
+++ trunk/htdocs/templates/contacts.html        2009-08-15 19:20:59 UTC (rev 
749)
@@ -0,0 +1,66 @@
+{% extends "base.html" %}
+
+{% block main %}
+
+  <p>
+    Before contacting the authors, please try the
+    <a href="http://rpy.sourceforge.net/maillist.html";>Rpy-talk Mailing 
List</a>.       (We do have
+    day jobs!)
+  </p>
+  <table border="0" cellpadding="0" cellspacing="0" width="100%">
+  <colgroup>
+    <col width="60"><col>
+  </colgroup>
+
+  <tbody>
+  <tr>
+  <td colspan="2"><h3>rpy</h3></a>
+  </tr>
+  <tr>
+  <td valign="top">
+    <img src="graphics/email.png" alt="mailbox">
+  </td>
+
+  <td valign="middle"> Walter Moreira.
+    <br>  Personal page: 
+    <a href="http://www.waltermoreira.net/";>
+      <span>www.waltermoreira.net</span>
+    </a>
+    <br><br><br>
+  </td>
+  </tr>
+
+  <tr>
+  <td valign="top">
+    <img src="graphics/email.png" alt="mailbox">
+  </td>
+
+  <td valign="middle"> Gregory R. Warnes
+    <br>
+    Personal page: <a href="http://www.warnes.net/";>www.warnes.net</a>
+    <br><br>
+  </td>
+
+  </tr>
+
+  <tr>
+  <td colspan="2"><h3>rpy2</h3></a>
+  </tr>
+  <tr>
+  <td valign="top">
+    <img src="graphics/email.png" alt="mailbox">
+  </td>
+
+  <td valign="middle"> Laurent Gautier
+    <br>
+    Personal email: <i>lgautier at gmail.com</i>
+    <br><br>
+  </td>
+  
+  </tr>
+
+
+  </tbody></table>
+
+{% endblock %}
+

Added: trunk/htdocs/templates/maillist.html
===================================================================
--- trunk/htdocs/templates/maillist.html                                (rev 0)
+++ trunk/htdocs/templates/maillist.html        2009-08-15 19:20:59 UTC (rev 
749)
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+
+{% block main %}
+  <p> 
+    The rpy-talk mailing list provides an open forum for discussion
+    and annoucements.
+  </p>
+
+  <ul>
+    <li>
+      <a href="https://lists.sourceforge.net/lists/listinfo/rpy-list";>
+       Subscribe/Unsubscribe/Preferences
+      </a>
+    </li>
+
+    <li>
+      <a 
href="http://sourceforge.net/mailarchive/forum.php?forum_name=rpy-list";>
+       List Archives
+      </a>
+    </li>
+  </ul>
+
+{% endblock %}
+

Added: trunk/htdocs/templates/rpy.html
===================================================================
--- trunk/htdocs/templates/rpy.html                             (rev 0)
+++ trunk/htdocs/templates/rpy.html     2009-08-15 19:20:59 UTC (rev 749)
@@ -0,0 +1,61 @@
+{% extends "base.html" %}
+
+{% block main %}
+  <p>
+    <strong>RPy</strong> is a very simple, yet robust, <a 
href="http://www.python.org/";>Python</a> interface to 
+    the <a href="http://www.r-project.org/";>R Programming Language</a>.        
 It can
+    manage all kinds of R objects and can execute arbitrary R functions
+    (including the graphic functions). All errors from the R language
+    are converted to Python exceptions.         Any module installed for the
+    R system can be used from within Python.
+  </p>
+
+  <p>
+    This code is inspired by <a 
href="http://www.omegahat.org/RSPython";>RSPython</a> from 
+    the <a href="http://www.omegahat.org/";>Omegahat project</a>. The main 
goals of
+    RPy are:
+  </p>
+
+  <ul>
+    <li> to have a <strong>very robust</strong> interface for using
+                       R <strong>from</strong> Python
+    </li>
+
+    <li> the interface should be as transparent and easy to use as
+                       possible
+    </li>
+
+    <li> it should be usable for real scientific and statistical
+                       computations
+    </li>
+  </ul>
+
+  <p>
+    Tim Churches wrote a <a 
href="http://rpy.sourceforge.net/rpy_demo.html";>demo</a>,
+    which illustrates the use of RPy.
+  </p>
+
+  <h4>Call for contributions</h4>
+
+  <p>
+    I appreciate all your feedback. If you have use RPy on a real
+    world project or if you have an interesting example or demo,
+    please, drop me a line. I'd like to collect some info, in this
+    pages, about real examples, to show the Python and R joint
+    capabilities. I hope that it will motivate many people in the
+    scientific and statistics world to use Python.
+  </p>
+
+
+  <p>
+    A tentative rewrite of RPy is being done, building on some of what
+    is existing but also redesigning a significant part. If you have wishes
+    to express, or will to participate, the moment is 
+    <a href="contacts.html">now</a>.
+  </p>
+
+  </div>
+    
+</td>
+
+{% endblock %}

Added: trunk/htdocs/templates/rpy_bugs.html
===================================================================
--- trunk/htdocs/templates/rpy_bugs.html                                (rev 0)
+++ trunk/htdocs/templates/rpy_bugs.html        2009-08-15 19:20:59 UTC (rev 
749)
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+
+{% block main %}
+
+  <p> Please report any bugs that you encounter using the SourceForge
+  bug tracking system.
+  </p>
+
+  <center>
+    <font size=+2>
+      <a href="http://sourceforge.net/tracker/?group_id=48422&atid=453021";>
+       RPy BUGS Page
+      </a>
+    </font>
+  </center>
+
+  <p>
+    This page also provides a list of currently active bugs:
+  </p>
+
+
+{% endblock %}
+

Added: trunk/htdocs/templates/rpy_demo.html
===================================================================
--- trunk/htdocs/templates/rpy_demo.html                                (rev 0)
+++ trunk/htdocs/templates/rpy_demo.html        2009-08-15 19:20:59 UTC (rev 
749)
@@ -0,0 +1,157 @@
+{% extends "base.html" %}
+
+{% block main %}
+<h3>A Demonstration of RPy:  <a href="mailto:tc...@optushome.com.au";>Tim 
Churches</a></h3>
+
+<p><b><a href="http://rpy.sourceforge.net/";>RPy</a></b>, written by Walter 
Moreira and maintained by Gregory Warnes, is a Python extension module for 
using the 
+<a href="http://www.r-project.org";>R programming environment for data analysis 
and graphics</a> from within <a href="http://www.python.org";>Python</a>.
+<p><b><a href="http://rpy.sourceforge.net/";>RPy</a></b> is available from the 
<a href="http://rpy.sourceforge.net/";>RPy project web page</a>.
+As Walter notes, RPy was inspired by <a 
href="http://www.omegahat.org/RSPython/index.html";>RSPython</a> by Duncan 
Temple Lang. RSPython
+allows R to be called from Python <b>and</b> vice-versa (i.e. Python can be 
embedded in R), as well as providing more general facilities for 
+exploiting the object-oriented aspects of both Python and R. However, at least 
for me, RPy is a lot easier to use. It is my sincere hope that
+RPy and RSPython can be merged in a display of el Norte/el Sur co-operation, 
so we can have the best of both.  
+
+<p>The following example provides a small taste of both the power of the R 
environment and the ease with which RPy allows this power to be used from 
within Python.
+<p>The data are eruption times for the Old Faithful geyser which, along with 
Yogi Bear, is located in the Yellowstone National Park in Wyoming, USA.
+The data file <a href="faithful.dat">faithful.dat</a> was exported from the 
faithful example dataset which comes as part of R. The R code in this
+example was borrowed directly from Section 8.2 of "<a 
href="http://cran.r-project.org/manuals.html";>An Introduction to R, Version 
1.4.1</a>" by W.N. Venables, D.M. Smith and the R Development Core Team.
+Minimal changes to the orginal R code were required to make it work from 
within Python, thanks to RPy.
+
+<p>The following Python code (<a href="faithful.py">faithful.py</a>):
+<table>
+<tr>
+<td>
+<pre class="rcode">
+from rpy import *
+
+faithful_data = {"eruption_duration":[],
+                 "waiting_time":[]}
+                
+f = open('faithful.dat','r')
+
+for row in f.readlines()[1:]: # skip the column header line
+    splitrow = row[:-1].split(" ")
+    faithful_data["eruption_duration"].append(float(splitrow[0]))
+    faithful_data["waiting_time"].append(int(splitrow[1]))
+
+f.close()
+
+ed = faithful_data["eruption_duration"] 
+edsummary = r.summary(ed)
+print "Summary of Old Faithful eruption duration data"
+for k in edsummary.keys():
+    print k + ": %.3f" % edsummary[k]
+print    
+print "Stem-and-leaf plot of Old Faithful eruption duration data"
+print r.stem(ed)
+
+r.png('faithful_histogram.png',width=733,height=550)
+r.hist(ed,r.seq(1.6, 5.2, 0.2), prob=1,col="lightgreen",
+       main="Old Faithful eruptions",xlab="Eruption duration (seconds)")
+r.lines(r.density(ed,bw=0.1),col="orange")
+r.rug(ed)
+r.dev_off()
+
+long_ed = filter(lambda x: x > 3, ed)
+r.png('faithful_ecdf.png',width=733,height=550)
+r.library('stepfun')
+r.plot(r.ecdf(long_ed), do_points=0, verticals=1, col="blue",
+       main=paste("Empirical cumulative distribution function",
+                  " of Old Faithful eruptions longer than 3 seconds")
+x = r.seq(3,5.4,0.01)
+r.lines(r.seq(3,5.4,0.01),r.pnorm(r.seq(3,5.4,0.01),mean=r.mean(long_ed), 
+        sd=r.sqrt(r.var(long_ed))), lty=3, lwd=2, col="red")
+r.dev_off()
+
+r.png('faithful_qq.png',width=733,height=550)
+r.par(pty="s")
+r.qqnorm(long_ed,col="blue")
+r.qqline(long_ed,col="red")
+r.dev_off()
+
+r.library('ctest')
+print
+print("Shapiro-Wilks normality test of Old Faithful eruptions" +\
+      " longer than 3 seconds")
+sw = r.shapiro_test(long_ed)
+print "W = %.4f" % sw['statistic']['W']
+print "p-value = %.5f" % sw['p.value']
+
+print
+print("One-sample Kolmogorov-Smirnov test of Old Faithful eruptions" +\
+      " longer than 3 seconds"
+ks = r.ks_test(long_ed,"pnorm", mean=r.mean(long_ed), 
+               sd=r.sqrt(r.var(long_ed)))
+print "D = %.4f" % ks['statistic']['D']
+print "p-value = %.4f" % ks['p.value']
+print "Alternative hypothesis: %s" % ks['alternative']
+print
+</pre>
+</td>
+</tr>
+</table>
+
+<p>produces the following output:
+
+<table>
+<tr>
+<td>
+
+<pre class="rcode">
+Summary of Old Faithful eruption duration data
+Mean: 3.488
+Median: 4.000
+3rd Qu.: 4.454
+1st Qu.: 2.163
+Min.: 1.600
+Max.: 5.100
+
+Stem-and-leaf plot of Old Faithful eruption duration data
+
+  The decimal point is 1 digit(s) to the left of the |
+
+  16 | 070355555588
+  18 | 000022233333335577777777888822335777888
+  20 | 00002223378800035778
+  22 | 0002335578023578
+  24 | 00228
+  26 | 23
+  28 | 080
+  30 | 7
+  32 | 2337
+  34 | 250077
+  36 | 0000823577
+  38 | 2333335582225577
+  40 | 0000003357788888002233555577778
+  42 | 03335555778800233333555577778
+  44 | 02222335557780000000023333357778888
+  46 | 0000233357700000023578
+  48 | 00000022335800333
+  50 | 0370
+
+None
+
+Shapiro-Wilks normality test of Old Faithful eruptions longer than 3 seconds
+W = 0.9793
+p-value = 0.01052
+
+One-sample Kolmogorov-Smirnov test of Old Faithful eruptions longer than 3 
seconds
+D = 0.0661
+p-value = 0.4284
+Alternative hypothesis: two.sided
+</pre>
+</td>
+</tr>
+</table>
+
+<p>and these graphs:
+
+<p><img src='demo/faithful_histogram.png'>
+<p><img src='demo/faithful_ecdf.png'>
+<p><img src='demo/faithful_qq.png'>
+
+<p>Impressed? I was.
+<p>Cheers,<br><br><a href="mailto:tc...@optushome.com.au";>Tim Churches</a>
+
+
+{% endblock %}

Added: trunk/htdocs/templates/rpy_download.html
===================================================================
--- trunk/htdocs/templates/rpy_download.html                            (rev 0)
+++ trunk/htdocs/templates/rpy_download.html    2009-08-15 19:20:59 UTC (rev 
749)
@@ -0,0 +1,76 @@
+{% extends "base.html" %}
+
+{% block main %}
+
+  <p>
+    You can download RPy from the 
+    <a href="http://sourceforge.net/project/showfiles.php?group_id=48422";>
+       RPy Sourceforge downloads page
+    </a>.
+  </p>
+  <p>
+    For <i>rpy2</i>, check the <a href="rpy2.html">rpy2 page</a>
+  </p>
+
+    <h3>Installation</h3>
+
+    <p>
+      For installation instructions, please see the <a
+      href="rpy/README">README</a> file (this file is also included in
+      the source distribution).
+    </p>
+
+  <p>
+    For some systems, you may need to do some minor libraries arrangement,
+    check the <a href="faq.html">FAQ</a>.
+  </p>
+
+  <h3>Notes for Window users:</h3>
+
+  On Windows, you must install the following Python extensions
+  in order to use RPy:
+  <ul>
+    <li>
+        <a 
href="http://starship.python.net/crew/mhammond/win32/Downloads.html";>
+            Mark Hammond's Python extensions
+        </a> 
+          (Conveniently included as part of
+          <a href="http://www.activestate.com/Products/ActivePython/";>
+            ActiveState Python
+        </a>)
+    </li>
+
+
+   <li> "NumPy" python module: 
+        <a href="http://numpy.sf.net/";>Main page</a>
+       <a 
href="http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103";>
+          Downloads</a> 
+        <b>Note that you need the <code>NumPy</code> module and
+        <it>not</it> <code>Numeric</code></b>
+   </li>
+ 
+  </ul>
+
+
+   You must use an Rpy binary that corresponds to the version of R,
+   and Python you have installed. For example,
+   <code>rpy-<b>0.4.6</b>-R-<b>2.0.0-to-2.2.1</b>-py<b>24</b>.win32.exe</code> 
is for
+   <ul>
+     <li> RPy version <b>0.4.6</b> </li>
+     <li> R versions <b>2.0.0 through 2.2.1</b> </li>
+        <li> Python version <b>2.4</b> </Li>
+   </ul>
+
+  <h3>Developers</h3>
+
+  <p>
+    The development version of RPy can be accessed via CVS in the
+    Sourceforge <a
+    href="http://sourceforge.net/svn/?group_id=48422";>repository</a>.
+    Be careful because the CVS version may be
+    unstable.
+  </p>
+
+
+{% endblock %}
+


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to