Hi List, 

I'm trying to call statistic program R (http://www.r-project.org/) with
the 'native' function (http://software-lab.de/doc/native.html).

I found a libR.so in my R distribution, copied it to my home folder and
changed the owner form root to my own user:

,---------------------------------------------------------
| -rwxr-xr-x     1 me  users 3143048 30. Jun 09:10 libR.so
`---------------------------------------------------------

Then I chose the sqrt() function in R, that works allright:

,-----------
| > sqrt(16)
| [1] 4
| > sqrt(4)
| [1] 2
`-----------

I can make 'native' work, but I don't really understand the outcomes: 

,---------------------------------------------------
| : (native "/home/my/folder/libR.so" "sqrt" 1.0 16)
| -> 1
| : (native "/home/my/folder/libR.so" "sqrt" 'N 16)
| -> 140734293053190
| : (native "/home/my/folder/libR.so" "sqrt" 'I 16)
| -> 1099665158
| : (native "/home/my/folder/libR.so" "sqrt" 'S 16)
| -> NIL
`---------------------------------------------------

,------------------------------------------------
| : (native "/home/my/folder/libR.so" "sqrt" 1.0 4)
| -> 1
| : (native "/home/my/folder/libR.so" "sqrt" 'N 4)
| -> 140734293053190
| : (native "/home/my/folder/libR.so" "sqrt" 'I 4)
| -> 1099665158
| : (native "/home/my/folder/libR.so" "sqrt" 'S 4)
| -> NIL
`------------------------------------------------

Might the [1] in '[1] 4' be the culprit, that is always returned, no
matter whats the actual argument/result? 

-- 
cheers,
Thorsten


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to