[postgis-users] kmeans/natural breaks returns R_HOME error when called
Jeff Cavner
jcavner at edac.unm.edu
Thu Oct 12 13:09:52 PDT 2006
In a post for March 2006 David Bitner had a nifty SQL function using plr for
natural breaks. I have successfully installed R and plr in postgress and
created the function in my database but when called with select
kmeans(array[1,1,1,1,4,3,5,6,45,3,5,7,8,6,4,3,2,1,32,6,7,5,6,7,8],4); to
test it , it reports ERROR: environment variable R_HOME not defined
I have noticed that when I run R from the command line I get the line
ignoring the R_HOME variable. When installing plr, I had problems with the
make file finding R.h. R.h lives in /usr/local/lib/R/include. But when I
looked at the plr makefile I noticed it was concatenating an extra /include
onto the path. So I set R_HOME using export R_HOME=/usr/local/lib/R (one
directory up from the actual location of R.h) since running my sql call to
the kmeans function I have changed R_HOME back to the actual location of
R.h. No path setting for R_HOME seems to allow me to call the kmeans
function. Each returns the same R_HOME error. Does any body know where
R_HOME is actually supposed to be set,e.g. to the R.h, the .so, the /bin?
And if anyone has had this problem why R_HOME works for the plr install but
not the actual execution of the function kmeans?
Jeff Cavner
Earth Data Analysis Center
University of New Mexico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20061012/aba2def5/attachment.html>
More information about the postgis-users
mailing list