"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 dataattach(mixture.example) #is just a simulated mixture data with 200 rows and 2 classesnames(mixture.example)
解决:
#
install.packages(packageurl, repos=NULL, type="source")
# https://cran.r-/src/contrib/Archive/ElemStatLearn/ElemStatLearn_.6.26.tar.gzpackageurl <- "https://cran.r-/src/contrib/Archive/ElemStatLearn/ElemStatLearn_.6.26.tar.gz"install.packages(packageurl, repos=NULL, type="source")
完整错误:
Warning message:"unable to access index for repository https://CRAN.R-/package=ElemStatLearn/src/contrib:无法打开URL'https://CRAN.R-/package=ElemStatLearn/src/contrib/PACKAGES'"Warning message:"package 'ElemStatLearn' is not available for this version of RA version of this package for your version of R might be available elsewhere,see the ideas athttps://cran.r-/doc/manuals/r-patched/R-admin.html#Installing-packages"Warning message:"unable to access index for repository https://CRAN.R-/package=ElemStatLearn/bin/windows/contrib/4.1:无法打开URL'https://CRAN.R-/package=ElemStatLearn/bin/windows/contrib/4.1/PACKAGES'"载入需要的程辑包:ElemStatLearnWarning 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-)
You can still install an archived version.
参考:Installing "ElemStatLearn" error
参考:R
参考:package ‘ElemStatLearn’ is not available (for R version 4.0.2)