“package ‘ElemStatLearn‘ is not available for this version of R
Posted Data+Science+Insight
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了“package ‘ElemStatLearn‘ is not available for this version of R相关的知识,希望对你有一定的参考价值。
"package 'ElemStatLearn' is not available for this version of R
问题:
# install.packages('ElemStatLearn')
# "package 'ElemStatLearn' is not available for this version of R
require(e1071)
install.packages('ElemStatLearn')
require(ElemStatLearn)#package containing the dataset
#Loading the data
attach(mixture.example) #is just a simulated mixture data with 200 rows and 2 classes
names(mixture.example)
解决:
#
install.packages(packageurl, repos=NULL, type="source")
# https://cran.r-project.org/src/contrib/Archive/ElemStatLearn/ElemStatLearn_2015.6.26.tar.gz
packageurl <- "https://cran.r-project.org/src/contrib/Archive/ElemStatLearn/ElemStatLearn_2015.6.26.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
完整错误:
Warning message:
"unable to access index for repository https://CRAN.R-project.org/package=ElemStatLearn/src/contrib:
无法打开URL'https://CRAN.R-project.org/package=ElemStatLearn/src/contrib/PACKAGES'"
Warning message:
"package 'ElemStatLearn' is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages"
Warning message:
"unable to access index for repository https://CRAN.R-project.org/package=ElemStatLearn/bin/windows/contrib/4.1:
无法打开URL'https://CRAN.R-project.org/package=ElemStatLearn/bin/windows/contrib/4.1/PACKAGES'"
载入需要的程辑包:ElemStatLearn
Warning message in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
"不存在叫'ElemStatLearn'这个名字的程辑包"
Error in attach(mixture.example): 找不到对象'mixture.example'
Traceback:
1. attach(mixture.example)
The package has been removed from CRAN:
CRAN - Package ElemStatLearn (r-project.org)
You can still install an archived version.
参考:Installing "ElemStatLearn" error
参考:R
参考:package ‘ElemStatLearn’ is not available (for R version 4.0.2)
以上是关于“package ‘ElemStatLearn‘ is not available for this version of R的主要内容,如果未能解决你的问题,请参考以下文章