[R] can install.packages() copy utility files to the public_html directory ?

Gabor Grothendieck ggrothendieck at gmail.com
Mon May 4 17:03:56 CEST 2009


2009/5/4 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
>
>
> Markus Loecher wrote:
>>
>> Dear fellow R-users,
>> I am about to publish an HTML utility package to CRAN that expands on the
>> R2HTML package and includes a few goodies such as sorted tables, easy
>> automation of framed HTML reporting, etc.
>> However, some of the resulting dynamic HTML pages need to access
>> JavaScript
>> code that should sit in a specific subdirectory of public_html.
>> My more general question is hence, (i) how do I include the directory
>> containing the JavaScript code in my R package and
>
> Yes, in directory ./inst/JavaScript for example that is copied to
> ./JavaScript during installation of the package.
>
>
>> (ii) is it possible to
>> copy this directory to the user's public_html path during installation ?
>
> Yes, if it is a source package (not for a binary package), BUT you should
> not write such code that copyies files to a directory different than the
> package's directory in the library that it is installed to. Things that
> install files to suprising locations are sometimes considered to be some
> kind of malware.
>

Also not all uses of R2HTML would be for use with a web
server at all.  Also you can't assume the directory is public_html
even if it is on a server.




More information about the R-help mailing list