developer tip

최신 버전의 RStudio 및 R Version.3.1.1에 패키지를 설치할 수 없습니다.

optionbox 2020. 11. 19. 08:05
반응형

최신 버전의 RStudio 및 R Version.3.1.1에 패키지를 설치할 수 없습니다.


최신 버전의 RStudio and R Version.3.1.1.Kindly 도움말을 통해 패키지를 설치할 수 없습니다 . 아래에 언급 된 오류가 발생했습니다.

Example:
Warning in install.packages :
  InternetOpenUrl failed: ''
Warning in install.packages :
  InternetOpenUrl failed: ''
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.1
Installing package into ‘C:/Users/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
  InternetOpenUrl failed: ''
Warning in install.packages :
  InternetOpenUrl failed: ''
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.1
Warning in install.packages :
  package ‘reshape’ is not available (for R version 3.1.1)

동일한 문제가 있다고 100 % 확신하지는 못했지만 내 작업이 제공된 각 미러 사이트 옵션을 차단하는 어려운 방법을 발견했고 다음과 같은 오류가 발생했습니다.

Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) : 
  unsupported URL scheme
Warning: unable to access index for repository https://rweb.crmda.ku.edu/cran/src/contrib
Warning message:
package ‘ggplot2’ is not available (for R version 3.2.2)

해결 방법 (CentOS를 사용하고 있습니다) ...

install.packages('package_name', dependencies=TRUE, repos='http://cran.rstudio.com/')

나는 이것이 누군가의 좌절의 시간을 절약하기를 바랍니다.


나는 이것이 "설정하고 잊어 버리는"해결책이라고 생각한다.

options(repos='http://cran.rstudio.com/')

이것은 https가 아닙니다. Linux 시스템에 ssh'ing in. https를 사용하면 작동하지 않았습니다.


@Pascal이 말했듯이 방화벽 또는 / 및 프록시 문제에 문제가 발생할 가능성이 있습니다. 첫 번째 단계로 CRAN 웹 페이지의 FAQ를 참조하십시오 . 그 후 --internet2로 R 플래그를 지정하십시오 .

때때로 R studio에서 전역 옵션을 확인하고 "HTTP 용 Internet Explorer 라이브러리 / 프록시 사용"을 선택 취소하는 것이 유용 할 수 있습니다. 도구-> 전역 옵션-> 패키지 및 "HTTP 용 Internet Explorer 라이브러리 / 프록시 사용"옵션을 선택 취소합니다.

도움이 되었기를 바랍니다.


커뮤니티의 답변에 따르면이 문제를 해결할 수있는 몇 가지 방법이 있습니다.

  1. 로부터 공식 자주 묻는 질문지원 포럼이 대답 , 당신은 인터넷에 연결 RStudio을 차단하는 방화벽 또는 프록시 문제가있을 수 있습니다 :

    • 방화벽 비활성화
    • 도구-> 전역 옵션-> 패키지"HTTP 용 Internet Explorer 라이브러리 / 프록시 사용" 옵션을 선택 취소하고 R을 다시 시작합니다 ( # 1 , # 2 , # 3 )
    • --internet2로 플래그 R
    • CentOS 에서는 다음을 시도하는 것이 좋습니다 .install.packages('package_name', dependencies=TRUE, repos='http://cran.rstudio.com/')
  2. 몇 가지 답변은 대체 미러 ( # 1 , # 2 , # 3 ) 사용을 제안합니다 .

    • 환경 설정> 일반> 기본 작업 디렉토리> 로컬 / 글로벌에서 미러 찾아보기 및 전환 (둘 중 선택되지 않은 항목)
  3. Windows에서는 다음을 사용하여 응용 프로그램을 시작할 수 있습니다 http_proxy=http://host:port/.

    • "C:\Program Files\RStudio\bin\rstudio.exe" http_proxy=http://host:port/
  4. Shut down and restart. Needed after many of the above operations, and suggested standalone.


My solution that worked was to open R studio options and select global miror (the field was empty before) and the error went away.


If you are on Windows, try this:

"C:\Program Files\RStudio\bin\rstudio.exe" http_proxy=http://host:port/


Please check the following to be able to install new packages:

1- In Tools -> Global Options -> Packages, uncheck the "Use Internet Explorer library/proxy for HTTP" option,

2- In Tools -> Global Options -> Packages, change the CRAN mirror to "0- Cloud - Rstudio, automatic redirection to servers worldwide"

3- Restart Rstudio.

4- Have fun!


What worked for me:

Preferences-General-Default working directory-Browse Switch from global to local mirror

Working on a Mac. 10.10.3


Most of the time @cer solution works but if in case its not working then try installing it in base R (NOT in R studio). As R studio runs base R executable in background so new package will be available in R studio as well. [my experience in macOS]

참고URL : https://stackoverflow.com/questions/25599943/unable-to-install-packages-in-latest-version-of-rstudio-and-r-version-3-1-1

반응형