Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well, imagine yourself as the setuptools packager and think of what you would expect the programmer to do.</p> <ul> <li>Setuptools knows nothing about R, its files' structure or that your code uses them somehow.</li> <li>Your R interpreter knows nothing about importing files from Python .egg's</li> </ul> <p>For the first problem, you have two choices:</p> <ol> <li>Tell setuptools to just include some additional files without bothering what they are</li> <li>Teach setuptools about R, how to determine what R files your program uses and how to track and include their dependencies</li> </ol> <p>The first option is implementable by passing <code>include_package_data = True</code> to <code>setup()</code> and providing masks of files to include in <code>package_data</code> (<a href="http://peak.telecommunity.com/DevCenter/setuptools#including-data-files" rel="nofollow">setuptools docs, "Including Data Files" section</a>). Paths relative to packages' directories can be used. The files will be accessible at run time at the same relative paths through the "Resource Management API" (<a href="http://svn.python.org/projects/sandbox/trunk/setuptools/setuptools.txt" rel="nofollow">"Accessing Data Files at Runtime" section</a>).</p> <p>The second option would require you to add your code to setuptools before invoking <code>setup()</code>. For example, you may <a href="http://peak.telecommunity.com/DevCenter/setuptools#adding-support-for-other-revision-control-systems" rel="nofollow">add a file finder</a> to add relevant .R files to the results of <code>find_packages()</code>. Or just generate the list of files for the previous paragraph by arbitrary means.</p> <p>For the second problem, the easiest way is to force setuptools to install the package as a directory rather than an .egg by specifying <a href="http://peak.telecommunity.com/DevCenter/setuptools#setting-the-zip-safe-flag" rel="nofollow"><code>zip_safe = False</code></a>. You might use <code>eager_resources</code> option instead that extracts a group of resources on demand (<a href="http://peak.telecommunity.com/DevCenter/setuptools#automatic-resource-extraction" rel="nofollow">"Automatic Resource Extraction" section</a>).</p> <p>As for installing third-party R packages, an automatable technique is described at <a href="http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages" rel="nofollow">R Installation and Administration - Installing packages</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload