0

I did search and couldn't find an answer. If anybody could glance at this and shares the what I am doing wrong, I'd really appreciate it:

This is what I have in my httpd.conf file:

<Directory /usr/local/apache2/htdocs/R> 
    SetHandler r-script 
    RHandler sys.source 
</Directory> 

This is the content of test.R, very simple:

<% 
x<-1:10000 
t=plot(x) 
print(t) 
%>

I get an Internal Server error when I enter the URL, http://localhost/R/test.R. Apache log says this:

Traceback: 
2: parse(n = -1, file = file) 
1: sys.source(file = "/usr/local/apache2/htdocs/R/test.R", envir = .rAenv)

Any ideas?

joran
  • 169,992
  • 32
  • 429
  • 468
george willy
  • 1,693
  • 8
  • 22
  • 26
  • Please don't cross-post between SO and the mailing list. Pick one, and if you don't get a good answer after several days, try the other. – joran Mar 06 '12 at 23:04

1 Answers1

0

As it says in Section 3.6.6 of the online Rapache manual, "Any file under /var/www/R-files [/usr/local/apache2/htdocs/R in your example] is passed through the function sys.source."

<% and %> are not valid R code, so sys.source pukes.

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418