简体   繁体   English

无法在 R Studio 中安装软件包

[英]Failing to install packages in R Studio

Whenever I try to install any package in R Studio, it returns following error:每当我尝试在 R Studio 中安装任何软件包时,它都会返回以下错误:

> install.packages('xtable')
Error in install.packages : Line starting '<!DOCTYPE HTML PUBLI ...' is malformed!

Above, I am trying to install xtable, and for the life it, it keeps returning the same error.上面,我正在尝试安装 xtable,并且在它的整个生命周期中,它一直返回相同的错误。 I have seen some solutions here about changing the mirror (which I did in Preferences->Packages and restarted) it didn't help either.我在这里看到了一些关于更改镜像的解决方案(我在 Preferences->Packages 中做了并重新启动)它也没有帮助。 Following is what is see in R_HOME/etc/repositories以下是在 R_HOME/etc/repositories 中看到的内容

menu_name       URL     default source  win.binary      mac.binary
CRAN    CRAN    @CRAN@  TRUE    TRUE    TRUE    TRUE
BioCsoft        "BioC software" %bm/packages/%v/bioc    FALSE   TRUE    TRUE    TRUE
BioCann "BioC annotation"       %bm/packages/%v/data/annotation FALSE   TRUE    TRUE    TRUE
BioCexp "BioC experiment"       %bm/packages/%v/data/experiment FALSE   TRUE    TRUE    TRUE
BioCextra       "BioC extra"    %bm/packages/%v/extra   FALSE   TRUE    TRUE    TRUE
CRANextra       CRAN (extras)   "http://www.stats.ox.ac.uk/pub/RWin"    FALSE   TRUE    TRUE    TRUE
Omegahat        Omegahat        http://www.omegahat.org/R       FALSE   TRUE    TRUE    FALSE
R-Forge R-Forge http://R-Forge.R-project.org    FALSE   TRUE    TRUE    TRUE
rforge.net      rforge.net      http://www.rforge.net   FALSE   TRUE    TRUE    TRUE

Not sure if anything is messed up here.不确定这里是否有任何问题。 Being a noob, don't want to mess with it too much.作为一个菜鸟,不要想太多。

My system is running MacOS Catalina.我的系统正在运行 MacOS Catalina。

I was able to resolve this by modifying global parameters.我能够通过修改全局参数来解决这个问题。 Looks like in R Studio, you can either change default mirrors from two places: 1. Preference -> Packages 2. Tools -> Global Options -> Packages看起来像在 R Studio 中,您可以从两个地方更改默认镜像:1. 首选项 -> 包 2. 工具 -> 全局选项 -> 包

When I changed the download mirror using second option, it worked without issues.当我使用第二个选项更改下载镜像时,它没有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM