Re: [R] CGIwithR installation failure

2013-06-09 Thread Prof Brian Ripley

On 08/06/2013 23:27, rex wrote:

Hello,

CGIwithR apparently is not available on CRAN for R 2.15.x, so I


It is not hosted on CRAN.  You should ask its maintainer (and package 
installation problems most often belong on the R-devel list).


See what the posting guide says about that and about upgrading your R 
before posting.



downloaded the source (0.73) and tried:

~/Downloads$ R CMD INSTALL CGIwithR
* installing to library ‘/home/rex/R/x86_64-pc-linux-gnu-library/2.15’
* installing *source* package ‘CGIwithR’ ...
configure: creating ./config.status
config.status: creating R/CGIwithR.R

   *

   After the installation of this R package is complete
   copy the files R.cgi and .Rprofile in
   /home/rex/R/x86_64-pc-linux-gnu-library/2.15/CGIwithR/cgi-bin/
   to the cgi-bin area of your Web server. If necessary,   modify the
settings in the first part of R.cgi to   suit your local configuration.

   *

** R
Error in parse(outFile) : embedded nul in string: '\0'
ERROR: unable to collate and parse R files for package ‘CGIwithR’


Any suggestions, including using a different package, appreciated.

Background: I want to solve the classic diet linear programming
problem. The CGI code needs to parse a POST, access a MySQL DB, solve
the problem (probably using the linprog package), and present the
solution to the vistor. I've done CGI programming in Python, but
not in R and don't know if CGIwithR is a good choice. It hasn't
been updated since 2005, so a more current package may be a better
choice. OTOH, my needs are (currently) simple so CGIwithR may
be an OK choice.

I've a Python version that does the above, except for finding the
lowest cost diet that meets constraints. The Python input form will be
used in the R version (no point in reinventing the wheel).

http://www.nosyntax.net/birdnutrit/

Thanks for any help.

-rex



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CGIwithR installation failure [SOLVED]

2013-06-09 Thread rex

rex r...@nosyntax.net [2013-06-08 18:05]:


CGIwithR apparently is not available on CRAN for R 2.15.x, so I
downloaded the source (0.73) and tried:

~/Downloads$ R CMD INSTALL CGIwithR


Typo. Actually, I downloaded 0.72. Later, I found 0.73 here:

http://cran.r-project.org/src/contrib/Archive/CGIwithR/

D/L 0.73
tar -xzvf CGIwithR_0.73-0.tar.gz
R CMD INSTALL CGIwithR
* installing to library ‘/home/rex/R/x86_64-pc-linux-gnu-library/2.15’
* installing *source* package ‘CGIwithR’ ...
** package ‘CGIwithR’ successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating R/CGIwithR.R

   *

   After the installation of this R package is complete
   copy the files R.cgi and .Rprofile in
   /home/rex/R/x86_64-pc-linux-gnu-library/2.15/CGIwithR/cgi-bin/
   to the cgi-bin area of your Web server. If necessary, 
   modify the settings in the first part of R.cgi to 
   suit your local configuration.


   *

** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded

* DONE (CGIwithR)


My slightly modified R.cgi, trivial.html  trivial.R are
below for reference (I'm running Debian Testing  R 2.15.3).

R.cgi

#! /bin/sh

###  A shell script to make CGI scripting possible in R.  Part of the
###  CGIwithR package for R.
###
###  Author: David Firth, University of Warwick 
###  (d.fi...@warwick.ac.uk)

###
###  Terms of use: GPL version 2 or later.  See COPYING in the
###  R distribution.
###
###  NO WARRANTY GIVEN, AND NO LIABILITY ACCEPTED FOR LOSS CAUSED BY
###  USE OF THIS PROGRAM
###
###
###  INSTALLING IT:
###
###  This file, and the one-line .Rprofile file included with the
###  package, must be placed together in a cgi-bin directory.  Both 
###  files should be readable (and this file executable) by the web 
###  server.

###
###
###  CONFIGURING IT:
###
###  First locate R on the local system (typically the answer 
###  to which R). This is the command to run R.
###  Individual R CGI scripts may request execution by a  
###  different, elsewhere-installed version of R; the R specified 
###  here is the default.


R_DEFAULT=/usr/bin/R
#R_DEFAULT=/usr/local/bin/R

###  Graphs can be included in the output using either the 
###  GDD package (available from cran.r-project.org) 
###  or via ghostscript.

###  GDD is the default.  If it is not installed, the webPNG()
###  function will attempt to use ghostscript.  You can specify
###  where the executable is located on your system via the R_GSCMD
###  environment variable.  If using GDD, you can ignore this.

R_GSCMD=/usr/bin/gs
#R_GSCMD=/usr/local/bin/gs
export R_GSCMD

###  The next two lines may optionally be edited to limit access
###  to local resources.
###
###  This line allows specification of the priority
###  given to the R process.  A nice of 0 is the normal  
###  priority, while e.g. +10 causes R to be run as a 
###  low-priority process.  The value NONE should be given if  
###  nice is not implemented locally.


R_NICE=NONE

###  This line allows the imposition of a length limit on the data
###  entered on an HTML form for processing by an R script.  
###  Setting MAX_DATA_LENGTH=1000, for example, aborts  
###  execution if the data length exceeds 1000 characters.  Or

###  use MAX_DATA_LENGTH=NONE to impose no limit here.

MAX_DATA_LENGTH=1000


###
### To make use of packages not installed in the default library for R
### i.e. `R RHOME`/library/, set the environment R_LIBS to identify
### one or more library directories containing the packages (separated by :).
### This is only necessary if the CGIwithR package itself is not located
### in the default library, e.g. if one is using a different version.

R_LIBS=/home/rex/R/x86_64-pc-linux-gnu-library/2.15/
export R_LIBS


###  No further configuration is needed.

No changes made in R.cgi below here.

trivial.html

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd;
html
head
titleAn example form for CGIwithR/title
meta name=generator content=BBEdit 6.1.2
/head
FORM action=http://www.nosyntax.net/cgi-bin/R.cgi/trivial.R; method=POST
body
Enter some words: INPUT type=text name=words value= size=20
BRBR
Now some numbers (separated by any kind of white space):BR
textarea name=numbers rows=6 cols=20/textarea

PINPUT type=submit size=3

/body
/html

trivial.R

#! /usr/bin/R

tag(HTML)
tag(HEAD)
tag(TITLE)
cat(An example R.cgi output page)
untag(TITLE)
untag(HEAD)
comments(Some comments to be ignored by the web browser)

lf(2)

tag(BODY, bgcolor = lightyellow)
lf(2)
tag(h3)
cat(A large heading)
untag(h3)

lf(2)

tag(p)
cat(Your words in italics:)

Re: [R] CGIwithR installation failure [SOLVED]

2013-06-09 Thread Prof Brian Ripley

On 09/06/2013 08:05, rex wrote:

rex r...@nosyntax.net [2013-06-08 18:05]:


CGIwithR apparently is not available on CRAN for R 2.15.x, so I
downloaded the source (0.73) and tried:

~/Downloads$ R CMD INSTALL CGIwithR


Typo. Actually, I downloaded 0.72. Later, I found 0.73 here:

http://cran.r-project.org/src/contrib/Archive/CGIwithR/


But see http://cran.r-project.org/package=CGIwithR for the current host.

--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CGIwithR installation failure

2013-06-09 Thread rex

Prof Brian Ripley rip...@stats.ox.ac.uk [2013-06-08 23:23]:

On 08/06/2013 23:27, rex wrote:

CGIwithR apparently is not available on CRAN for R 2.15.x, so I


It is not hosted on CRAN.  You should ask its maintainer (and package 
installation problems most often belong on the R-devel list).


Actually it is, but not in the usual place.

See what the posting guide says about that and about upgrading your R 
before posting. 


I did read the posting guide before posting, and I'm in no hurry to
upgrade R, thank you. As you can see from my [Solved] post, the problem
was with 0.72, and 0.73 works with R 2.15.3.


Background: I want to solve the classic diet linear programming
problem. The CGI code needs to parse a POST, access a MySQL DB,
solve the problem (probably using the linprog package), and present
the solution to the vistor. I've done CGI programming in Python, but
not in R and don't know if CGIwithR is a good choice. It hasn't been
updated since 2005 [0.73 was updated in 2010], so a more current
package may be a better choice. OTOH, my needs are (currently)
simple so CGIwithR may be an OK choice.


It would have been nice to get some feedback on the suitability of 
CGIwithR compared to other CGI alternatives.


-rex
--
Life would be easier if I had the source code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CGIwithR installation failure [SOLVED]

2013-06-09 Thread rex

Prof Brian Ripley rip...@stats.ox.ac.uk [2013-06-09 00:22]:

On 09/06/2013 08:05, rex wrote:

Typo. Actually, I downloaded 0.72. Later, I found 0.73 here:

http://cran.r-project.org/src/contrib/Archive/CGIwithR/


But see http://cran.r-project.org/package=CGIwithR for the current host.


I did; that's where I found the link to the CRAN archive that has 0.73.
The http://www.omegahat.org/CGIwithR/ link is to 0.72. IOW, the CRAN
archive is more up-to-date than the current host.

-rex
--
Nostalgia ain't what it used to be.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] CGIwithR installation failure

2013-06-08 Thread rex

Hello,

CGIwithR apparently is not available on CRAN for R 2.15.x, so I
downloaded the source (0.73) and tried:

~/Downloads$ R CMD INSTALL CGIwithR
* installing to library ‘/home/rex/R/x86_64-pc-linux-gnu-library/2.15’
* installing *source* package ‘CGIwithR’ ...
configure: creating ./config.status
config.status: creating R/CGIwithR.R

  *

  After the installation of this R package is complete
  copy the files R.cgi and .Rprofile in
  /home/rex/R/x86_64-pc-linux-gnu-library/2.15/CGIwithR/cgi-bin/
  to the cgi-bin area of your Web server. If necessary, 
  modify the settings in the first part of R.cgi to 
  suit your local configuration.


  *

** R
Error in parse(outFile) : embedded nul in string: '\0'
ERROR: unable to collate and parse R files for package ‘CGIwithR’


Any suggestions, including using a different package, appreciated.

Background: I want to solve the classic diet linear programming
problem. The CGI code needs to parse a POST, access a MySQL DB, solve
the problem (probably using the linprog package), and present the
solution to the vistor. I've done CGI programming in Python, but
not in R and don't know if CGIwithR is a good choice. It hasn't
been updated since 2005, so a more current package may be a better
choice. OTOH, my needs are (currently) simple so CGIwithR may
be an OK choice.

I've a Python version that does the above, except for finding the
lowest cost diet that meets constraints. The Python input form will be
used in the R version (no point in reinventing the wheel).

http://www.nosyntax.net/birdnutrit/

Thanks for any help.

-rex
--
If at first you do succeed, try not to look astonished.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.