|||
------------------------------------------------------------
2014-04-26 13:29:17 下午 安装ggplot2失败记录(不喜欢的直接拉到底部看结论)
------------------------------------------------------------
#环境:windows XP + R 3.03
install.packages("ggplot2")
--- 在此連線階段时请选用CRAN的鏡子 ---
#选择的镜像是国内China(Beijing2)
also installing the dependencies ‘colorspace’, ‘Rcpp’, ‘stringr’, ‘RColorBrewer’, ‘dichromat’, ‘munsell’, ‘labeling’, ‘plyr’, ‘digest’, ‘gtable’, ‘reshape2’, ‘scales’, ‘proto’
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/colorspace_1.2-4.zip'
Content type 'application/zip' length 384299 bytes (375 Kb)
打开了URL
downloaded 375 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/Rcpp_0.11.1.zip'
Content type 'application/zip' length 3009433 bytes (2.9 Mb)
打开了URL
downloaded 4053 bytes
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/stringr_0.6.2.zip'
Content type 'application/zip' length 75038 bytes (73 Kb)
打开了URL
downloaded 73 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/RColorBrewer_1.0-5.zip'
Content type 'application/zip' length 25286 bytes (24 Kb)
打开了URL
downloaded 24 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/dichromat_2.0-0.zip'
Content type 'application/zip' length 147536 bytes (144 Kb)
打开了URL
downloaded 144 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/munsell_0.4.2.zip'
Content type 'application/zip' length 126490 bytes (123 Kb)
打开了URL
downloaded 123 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/labeling_0.2.zip'
Content type 'application/zip' length 40403 bytes (39 Kb)
打开了URL
downloaded 39 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/plyr_1.8.1.zip'
Content type 'application/zip' length 1150878 bytes (1.1 Mb)
打开了URL
downloaded 1.1 Mb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/digest_0.6.4.zip'
Content type 'application/zip' length 136446 bytes (133 Kb)
打开了URL
downloaded 12 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/gtable_0.1.2.zip'
Content type 'application/zip' length 63558 bytes (62 Kb)
打开了URL
downloaded 62 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/reshape2_1.4.zip'
Content type 'application/zip' length 500016 bytes (488 Kb)
打开了URL
downloaded 488 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/scales_0.2.4.zip'
Content type 'application/zip' length 150525 bytes (146 Kb)
打开了URL
downloaded 146 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/proto_0.3-10.zip'
Content type 'application/zip' length 458271 bytes (447 Kb)
打开了URL
downloaded 122 Kb
试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/ggplot2_0.9.3.1.zip'
Content type 'application/zip' length 2656714 bytes (2.5 Mb)
打开了URL
downloaded 929 Kb
程序包‘colorspace’打开成功,MD5和检查也通过
错误于read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
无法打开链结
此外: 警告信息:
1: In download.file(url, destfile, method, mode = "wb", ...) :
下载的长度4053不等于报告的长度3009433
2: In download.file(url, destfile, method, mode = "wb", ...) :
下载的长度12694不等于报告的长度136446
3: In download.file(url, destfile, method, mode = "wb", ...) :
下载的长度125015不等于报告的长度458271
4: In download.file(url, destfile, method, mode = "wb", ...) :
下载的长度951573不等于报告的长度2656714
5: In unzip(zipname, exdir = dest) : 从zip文件中抽取1时出了错
6: In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
无法打开压缩文件'Rcpp/DESCRIPTION',可能是因为'No such file or directory'
>
--------------------------------------------------------------------------------
悲剧结束!!!想想五一快到啦!
--------------------------------------------------------------------------------
============================================================
2014-05-04 22:36:17 安装ggplot2成功记录
============================================================
Welcome at Sun May 04 22:08:34 2014
#选择厦门大学信息与网络中心开源软件镜像服务China(Xiamen)
#http://mirrors.xmu.edu.cn/
#欢迎使用厦门大学信息与网络中心开源软件镜像服务
> install.packages("ggplot2")
--- 在此連線階段时请选用CRAN的鏡子 ---
also installing the dependencies ‘colorspace’, ‘Rcpp’, ‘munsell’, ‘labeling’, ‘plyr’, ‘reshape2’, ‘scales’, ‘proto’
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/colorspace_1.2-4.zip'
Content type 'application/zip' length 384262 bytes (375 Kb)
打开了URL
downloaded 375 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/Rcpp_0.11.1.zip'
Content type 'application/octet-stream' length 3009433 bytes (2.9 Mb)
打开了URL
downloaded 2.9 Mb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/munsell_0.4.2.zip'
Content type 'application/zip' length 126002 bytes (123 Kb)
打开了URL
downloaded 123 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/labeling_0.2.zip'
Content type 'application/zip' length 40403 bytes (39 Kb)
打开了URL
downloaded 39 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/plyr_1.8.1.zip'
Content type 'application/zip' length 1146073 bytes (1.1 Mb)
打开了URL
downloaded 1.1 Mb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/reshape2_1.4.zip'
Content type 'application/zip' length 500182 bytes (488 Kb)
打开了URL
downloaded 488 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/scales_0.2.4.zip'
Content type 'application/zip' length 150718 bytes (147 Kb)
打开了URL
downloaded 147 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/proto_0.3-10.zip'
Content type 'application/octet-stream' length 457971 bytes (447 Kb)
打开了URL
downloaded 447 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/ggplot2_0.9.3.1.zip'
Content type 'application/octet-stream' length 2657534 bytes (2.5 Mb)
打开了URL
downloaded 2.5 Mb
程序包‘colorspace’打开成功,MD5和检查也通过
程序包‘Rcpp’打开成功,MD5和检查也通过
程序包‘munsell’打开成功,MD5和检查也通过
程序包‘labeling’打开成功,MD5和检查也通过
程序包‘plyr’打开成功,MD5和检查也通过
程序包‘reshape2’打开成功,MD5和检查也通过
程序包‘scales’打开成功,MD5和检查也通过
程序包‘proto’打开成功,MD5和检查也通过
程序包‘ggplot2’打开成功,MD5和检查也通过
下载的二进制程序包在
C:Documents and SettingsAdministratorLocal SettingsTempRtmpCEWHT4downloaded_packages里
>
#全部复制备份
============================================================
开始使用又遇到事故-程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装
============================================================
#装载库文件
library("ggplot2")
#装载库文件出现错误警告
Error : 程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装
错误: ‘ggplot2’程辑包或名字空间载入失败
#搜索解决方案如下
##清除以前的文件夹,特别是配置文件,还有安装2.x后,在线更新一下,选国内的镜像。
##已经换回2.15.3……,连2.15.2 都不行……
##install.packages("ggplot2",type='source')
##一个最简单粗暴的方法就是你的RGUI上的工具栏上有一个packages的选项,下拉菜单里有一个update packages,
##把已安装的包卸掉,再从CRAN上重新下载再加载就行了
##你好,您提的方法好像都无法再R3.02中安装mvtnorm包,换成以前版本是可以的,但是这个包是一个计量包的附带包,那个计量包在以前版本无法安装,实在无法解决这个问题,能否请高手指点迷津,谢谢!
##更新R版本的话,一般这些包好像都还在的
##update.packages() 选择镜像后,可以选择y来更新你想要更新的包。
##如果是重新安装R版本,不知道原来有的包还在不,不在的话,只有重安了,可以将你所要安的包,全部赋予pkgs,pkgs=c("","",""...)
##在R 2.15.3环境下,我试了一下,安装是正常的。
##开始尝试
> library("ggplot2")
##错误依旧
Error : 程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装
错误: ‘ggplot2’程辑包或名字空间载入失败,
##更新
> update.packages(ask='graphics',checkBuilt=TRUE)
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/boot_1.3-11.zip'
Content type 'application/zip' length 587583 bytes (573 Kb)
打开了URL
downloaded 573 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/class_7.3-10.zip'
Content type 'application/zip' length 99786 bytes (97 Kb)
打开了URL
downloaded 97 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/cluster_1.15.2.zip'
Content type 'application/zip' length 511507 bytes (499 Kb)
打开了URL
downloaded 499 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/digest_0.6.4.zip'
Content type 'application/zip' length 136446 bytes (133 Kb)
打开了URL
downloaded 133 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/foreign_0.8-61.zip'
Content type 'application/zip' length 288417 bytes (281 Kb)
打开了URL
downloaded 281 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/KernSmooth_2.23-12.zip'
Content type 'application/zip' length 104992 bytes (102 Kb)
打开了URL
downloaded 102 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/lattice_0.20-29.zip'
Content type 'application/zip' length 726567 bytes (709 Kb)
打开了URL
downloaded 709 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/MASS_7.3-32.zip'
Content type 'application/zip' length 1086730 bytes (1.0 Mb)
打开了URL
downloaded 1.0 Mb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/Matrix_1.1-3.zip'
Content type 'application/zip' length 3568556 bytes (3.4 Mb)
打开了URL
downloaded 3.4 Mb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/mgcv_1.7-29.zip'
Content type 'application/zip' length 1601316 bytes (1.5 Mb)
打开了URL
downloaded 1.5 Mb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/nlme_3.1-117.zip'
Content type 'application/zip' length 2135164 bytes (2.0 Mb)
打开了URL
downloaded 2.0 Mb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/nnet_7.3-8.zip'
Content type 'application/zip' length 118787 bytes (116 Kb)
打开了URL
downloaded 116 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/rpart_4.1-8.zip'
Content type 'application/zip' length 918643 bytes (897 Kb)
打开了URL
downloaded 897 Kb
试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/spatial_7.3-8.zip'
Content type 'application/zip' length 150470 bytes (146 Kb)
打开了URL
downloaded 146 Kb
程序包‘boot’打开成功,MD5和检查也通过
程序包‘class’打开成功,MD5和检查也通过
程序包‘cluster’打开成功,MD5和检查也通过
程序包‘digest’打开成功,MD5和检查也通过
程序包‘foreign’打开成功,MD5和检查也通过
程序包‘KernSmooth’打开成功,MD5和检查也通过
程序包‘lattice’打开成功,MD5和检查也通过
程序包‘MASS’打开成功,MD5和检查也通过
程序包‘Matrix’打开成功,MD5和检查也通过
程序包‘mgcv’打开成功,MD5和检查也通过
程序包‘nlme’打开成功,MD5和检查也通过
程序包‘nnet’打开成功,MD5和检查也通过
程序包‘rpart’打开成功,MD5和检查也通过
程序包‘spatial’打开成功,MD5和检查也通过
下载的二进制程序包在
C:Documents and SettingsAdministratorLocal SettingsTempRtmpCEWHT4downloaded_packages里
#备份下
> library("ggplot2")
Error : 程辑包‘proto’是在R版本3.0.0之前建的:你得重新安装
错误: ‘ggplot2’程辑包或名字空间载入失败,
============================================================
又遇到事故-程辑包‘proto’是在R版本3.0.0之前建的:你得重新安装
============================================================
##强制更新update.packages("proto")没啥反应
> update.packages("proto")
##源文件安装包文件
install.packages("proto",type="source")
试开URL’http://mirrors.xmu.edu.cn/CRAN/src/contrib/proto_0.3-10.tar.gz'
Content type 'application/x-gzip' length 530758 bytes (518 Kb)
打开了URL
downloaded 518 Kb
Welcome at Sun May 04 22:34:14 2014
* installing *source* package 'proto' ...
** 成功将'proto'程序包解包并MD5和检查
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
'proto.Rnw'
'protoref.Rnw'
** testing if installed package can be loaded
Welcome at Sun May 04 22:34:16 2014
Goodnye at Sun May 04 22:34:16 2014
* DONE (proto)
Goodnye at Sun May 04 22:34:17 2014
下载的程序包在
‘C:Documents and SettingsAdministratorLocal SettingsTempRtmpCEWHT4downloaded_packages’里
>
#备份
library("ggplot2")
##老大,终于没有错误了。
##
ggplot(yx)
错误: ggplot2 doesn't know how to deal with data of class numeric
#
#ggplot2只给dataframe面子
#ggplot(data=dat,aes(x=r_salary,y=r_sales))+geom_line()
#ggplot example
mydata <- data.frame(x = -100:100)
myfun <- function(x) x^2 + x + 1
ggplot(data = mydata, aes(x = x)) +
stat_function(fun = myfun, geom = "point")
#ggplot,散点图,用label在点上标注。但我想标注部分点,例如前10个,怎么做呢?
因为数据比较大,所有点都label,根本看不清标注带的内容。所以就想部分标注。
pointLabels <- vector('character',length=nrow(mtcars))
pointLabels[1:10] <- rownames(mtcars)[1:10]
p <- ggplot(mtcars, aes(x=wt, y=mpg, label=pointLabels,
color=(pointLabels=="")))
p + geom_point() +
geom_text(vjust=1.2) +
theme(legend.position="none")
============================================================
#windows xp R 3.03 install ggplot2收工总结
01-选择镜像很重要
#选择厦门大学信息与网络中心开源软件镜像服务China(Xiamen)
#http://mirrors.xmu.edu.cn/
02-安装与装载检查
install.packages("ggplot2")
library("ggplot2")
03-装载检查出错_更新
library("ggplot2")装载ggplot包时出现类似错误按照如下依次执行:
e.g.程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装
a.RGUI上的工具栏上有一个packages的选项,下拉菜单里有一个update packages,全部更新
b.全部更新之后,还是有个别需要重新安装的,使用源文件安装相应的包文件
e.g.程辑包‘proto’是在R版本3.0.0之前建的:你得重新安装
##源文件安装包文件
install.packages("proto",type="source")
04-祝你享用ggplot愉快
============================================================
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-26 17:36
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社