Common Lisp中調用R

R是功能強大的統計軟件,和Lisp同樣也有一個交互式的命令行環境,還有衆多的擴展庫,能夠用來進行專業的統計分析。要在Common Lisp中方便的調用R的功能,能夠試用rcl這個庫。安裝方法很簡單,由於它已經歸入到quicklisp庫中了: html

(ql:quickload 「rcl」) linux

使用: svn

Source code    
* (use-package :rcl)                                                                 T    
* (r-init)                                                                           T
* (r "R.Version")  ("x86_64-pc-linux-gnu" "x86_64" "linux-gnu" "x86_64, linux-gnu" "" "2" "12.1" "2010" "12" "16" "53855" "R" "R version 2.12.1 (2010-12-16)") ((:NAMES "platform" "arch" "os" "system" "status" "major" "minor" "year" "month" "day" "svn rev" "language" "version.string")) 
* (r "seq" 1 5)                                                                      (1 2 3 4 5) 
* (r "*" 2 (r "seq" 1 5))                                                            (2 4 6 8 10) 
* (r "summary" '(123 543 3242 8934 234 643))                                         (123.0d0 311.2d0 593.0d0 2286.0d0 2592.0d0 8934.0d0)
相關文章
相關標籤/搜索