4

Ryacasでパッケージを使用しようとしていますR。ここで何が起こっているのですか:

> install.packages("Ryacas")
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://www.stats.bris.ac.uk/R/bin/windows/contrib/2.14/Ryacas_0.2-11.zip'
Content type 'application/zip' length 263424 bytes (257 Kb)
opened URL
downloaded 257 Kb

package ‘Ryacas’ successfully unpacked and MD5 sums checked

The downloaded packages are in
    C:\Documents and Settings\yogcal\Local Settings\Temp\RtmpKeuu7m\downloaded_packages

次に、ロードしようとしますRyacas

> library(Ryacas)
Loading required package: XML
C:\Program Files\R\R-2.14.1\library\Ryacas\yacdir\yacas.exe 
   or C:\Program Files\R\R-2.14.1\library\Ryacas\yacdir\scripts.dat 
 not found.
Run yacasInstall() without arguments to install yacas.

だから私は実行しますyacasInstall()

> yacasInstall()
trying URL 'http://ryacas.googlecode.com/files/yacas-1.0.63.zip'
Content type 'application/x-zip' length 746009 bytes (728 Kb)
opened URL
downloaded 728 Kb

そして、私が例を試すと:

> library(Ryacas)
> yacas("TeXForm(3 * x^2/(2 * (x + 1)) - (x^3) * 2/(2 * (x + 1))^2)", 
+  retclass = "unquote")
[1] "Starting Yacas!"
Error in socketConnection(host = "127.0.0.1", port = 9734, server = FALSE,  : 
  cannot open the connection
In addition: Warning message:
In socketConnection(host = "127.0.0.1", port = 9734, server = FALSE,  :
  127.0.0.1:9734 cannot be opened
> 

ここで何がうまくいかないのですか?

どうもありがとう...

4

2 に答える 2

0

2 つの可能性: 1) Yacas が開始されなかった。(R は Yacas をロードしません。) 2) 接続がブロックされました。オペレーティング システムから Yacas を起動したと仮定すると、セキュリティ管理ツールを使用してそのポートを開く必要があります。これは R の問題ではなく、オペレーティング システム/ファイアウォールの問題です。

スタート メニューから Yacas を起動する必要があることについて、私は間違っているかもしれません。これは次のコードです。

runYacas()
### You should not need to type any of what follows. Just use the command above.
runYacas <- function(method = "system", yacas.args = "", yacas.init = "") {
   cmd <- yacasInvokeString(method = method, yacas.args = yacas.args, yacas.init = yacas.init)
   if (.Platform$OS.type == "windows") 
      system(cmd, wait = FALSE, invisible = FALSE)
   else system(cmd, wait = FALSE)
}

システムを呼び出すように見えるので、Rプロンプトで試してみます。

于 2012-01-09T20:20:24.283 に答える
0

問題を解決する 1 つの方法は、ポートが開いていることを確認することです。

1) WindowsをクリックStart

2) クリックAll Programs

3) クリック Accessories

4) クリックCommand Promptして DOS ウィンドウを開きます

5) 次のように入力して、ディレクトリを yacas.exe があるディレクトリ (おそらく C:\Program Files\yacas\winrel) に変更します。cd C:\Program Files\yacas\winrel

6) 次のように入力して、サーバーで yacas を開始します。yacas --server 9734

7) Yacas は次のフィードバックを提供します。Accepting requests from port 9734

この時点まですべてが機能していれば、yacas が実行されており、話す準備ができています。これで、R コードを実行できます。うまくいかない場合は、yacas に問題があります。

于 2012-02-06T22:27:27.317 に答える