1

Vincent Goulet から Windows XP 用に修正された Emacs バージョンをインストールしました。ess-remote を使用して、リモートの Unix サーバーに含まれる R スクリプトを実行および編集したいと考えています。多くの検索の後、次の方法でリモート R セッションに接続できます。

  1. でシェルプロンプトを開きますM-x shell
  2. 次のコマンドを入力します。plink -X -C username@server
  3. パスワードを入力したら、簡単なコマンドでシェルで R を起動しますR
  4. コマンドでこれをリモートプロセスとして割り当てますM-x ess-remote

私は R と正常に対話できますが、常に二重のプロンプトが表示され、さらに悪いことに、関数のヘルプ ファイルを開くと、読みやすい R ヘルプで新しいバッファーを開く代わりに、同じ R プロセス バッファーに文字化けしたテキストが表示されます。文章。通常の emacs と R の対話のように、ヘルプ バッファを別のウィンドウで開くにはどうすればよいですか? また、シェルを実行するときに二重のプロンプトを表示しないようにするにはどうすればよいですか?

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\Documents and Settings\username>plink -X -C username@remoteserver
plink -X -C username@remoteserver
username@remoteserver's password: 

[username@remoteserver ~]$ R
R

R version 2.11.0 (2010-04-22)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.


Welcome at Sat Jul 24 11:50:45 2010 
> 
> options(STERM='iESS')
options(STERM='iESS')
> 
> x <- c(1,2,3)
> 
> x
[1] 1 2 3
> 
> ?mean(x)
  [?1049h[?1h=[24;1H[Kmean                   package:base                    R        Documentation

Arithmetic Mean

Description:

 Generic function for the (trimmed) arithmetic mean.

Usage:

 mean(x, ...)

 ## Default S3 method:
 mean(x, trim = 0, na.rm = FALSE, ...)

Arguments:

   x: An R object.  Currently there are methods for numeric/logical
      vectors and date, date-time and time interval objects, and
      for data frames all of whose columns have a method.  Complex
      vectors are allowed for 'trim = 0', only.

trim: the fraction (0 to 0.5) of observations to be trimmed from

[24;1H[K:[24;1H[24;1H[K] 平均が計算される前の「x」の各端。その範囲外のトリム [24;1H[K: [24;1H[24;1H[K] の値は、最も近いエンドポイントと見なされます。

na.rm: a logical value indicating whether 'NA' values should be
      stripped before the computation proceeds.

 ...: further arguments passed to or from other methods.

Value:

 For a data frame, a named vector with the appropriate method being
 applied column by column.

 If 'trim' is zero (the default), the arithmetic mean of the values
 in 'x' is computed, as a numeric or complex vector of length one.
 If 'x' is not logical (coerced to numeric), numeric (including
 integer) or complex, 'NA_real_' is returned, with a warning.

 If 'trim' is non-zero, a symmetrically trimmed mean is computed
 with a fraction of 'trim' observations deleted from each end
 before the mean is computed.

References:

[24;1H[K:[24;1H[24;1H[K     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
[24;1H[K:[24;1H[24;1H[K     Language_.  Wadsworth & Brooks/Cole.
[24;1H[K:
[24;1H[24;1H[K
[24;1H[K:[24;1H[24;1H[KSee Also:
[24;1H[K:
[24;1H[24;1H[K
[24;1H[K:[24;1H[24;1H[K     'weighted.mean', 'mean.POSIXct', 'colMeans' for row and     column
[24;1H[K:
[24;1H[24;1H[K     means.
[24;1H[K:[24;1H[24;1H[K
[24;1H[K:
[24;1H[24;1H[KExamples:
[24;1H[K:[24;1H[24;1H[K
[24;1H[K:
[24;1H[24;1H[K     x <- c(0:10, 50)
[24;1H[K:[24;1H[24;1H[K     xm <- mean(x)
[24;1H[K:
[24;1H[24;1H[K     c(xm, mean(x, trim = 0.10))
[24;1H[K:[24;1H[24;1H[K     
[24;1H[K:
[24;1H[24;1H[K     mean(USArrests, trim = 0.2)
[24;1H[K:[24;1H[24;1H[K     
[24;1H[K:
[24;1H[24;1H[K
[24;1H[K:[24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 
[24;1H[24;1H[K[24;1H[K(END) [24;1H[24;1H[K[24;1H[K(END) 

参考までに、site-start.el のトランプ インクルージョンの内容を次に示します。

(require 'tramp)
;(setq tramp-chunksize "500")
(setq tramp-default-method "plink")

(setq exec-path
      (cons
   (expand-file-name "C:/putty_shortcut/")
        exec-path)) 
4

1 に答える 1

0

カラー コードの問題については、シェル モードで ansi-color サポートを有効にする必要があります。

;; Shell mode
(add-hook
 'shell-mode-hook
 (function (lambda ()
             (ansi-color-for-comint-mode-on))))

あなたの例では二重プロンプトは表示されませんが、カスタム シェル autoexec ファイルを作成してカスタム プロンプトを設定できます。

(編集: ああ、あなたは>R 内で二重のプロンプトを意味していました。それについてはわかりません。申し訳ありません。誰かに役立つ場合に備えて、以下のコメントを残します...)

使用されるプログラムは、変数 `explicit-shell-file-name'、または (nil の場合) ESHELL 環境変数、または (nil の場合) `shell-file-name' から取得されます。ファイル`~/.emacs_SHELLNAME'または`~/.emacs.d/init_SHELLNAME.sh'が存在する場合、初期入力として与えられます

たとえば、単純な無色のプロンプトをinit_bash.sh含む場合があります。export PS1="\n\u@\h \w $ "

詳細については、を参照C-h f shell RETしてください。

于 2010-07-25T06:08:36.683 に答える