터미널의 모든 너비를 사용하도록 R을 설정하는 방법은 무엇입니까?

터미널의 모든 너비를 사용하도록 R을 설정하는 방법은 무엇입니까?

터미널에서 대화형으로 실행 중이지만 R터미널의 전체 너비를 사용하지 않습니다. 226자 중 72자만 사용합니다. 대화형으로 표시된 많은 수의 열에서 데이터를 읽는 것은 매우 불편합니다 R.

나는 .urxvtdebian 9,8

답변1

바라보다 ?option:

 ‘width’: controls the maximum number of columns on a line used in
      printing vectors, matrices and arrays, and when filling by
      ‘cat’.

      Columns are normally the same as characters except in East
      Asian languages.

      You may want to change this if you re-size the window that R
      is running in.  Valid values are 10...10000 with default
      normally 80.  (The limits on valid values are in file
      ‘Print.h’ and can be changed by re-compiling R.)  Some R
      consoles automatically change the value when they are
      resized.

쿼리 값:

R> getOption("width")
[1] 80

이 값을 변경하려면( ~/.Rprofile영구적으로 변경하려면 이 값을 추가하세요):

options("width"=200)

답변2

방금 다음을 찾았습니다. 잘 작동하는 것 같지만 거의 테스트해 본 적이 없습니다.

options(width=Sys.getenv("COLUMNS"))
options(setWidthOnResize=TRUE)

전자는 시작 시 실행되도록 함수로 래핑할 수 있고, 후자는 .Rprofile함수에 추가할 수도 있습니다.

관련 정보