[问题] histogram X轴

楼主: decken (HAHAHA~)   2016-05-29 03:11:10
[问题类型]:
程式咨询(我想用R 做某件事情,但是我不知道要怎么用R 写出来)
[软件熟悉度]:
入门(写过其他程式,只是对语法不熟悉)
[问题叙述]:
请简略描述你所要做的事情,或是这个程式的目的
自己想要用histogram画某个东西(cipher suite)的出现频率,
资料如下:
Cipher.Suite times
DES-CBC3-SHA 2
AES256-SHA 4
ECDHE-RSA-DES-CBC3-SHA 1
DHE-RSA-AES256-GCM-SHA384 2
ECDHE-RSA-AES128-GCM-SHA256 94
ECDHE-RSA-AES256-SHA384 7
ECDHE-RSA-AES128-SHA 2
AES256-SHA256 3
AES128-SHA 1
ECDHE-ECDSA-AES128-GCM-SHA256 13
AES256-GCM-SHA384 3
ECDHE-RSA-AES256-GCM-SHA384 29
AES128-GCM-SHA256 3
DHE-RSA-AES256-SHA 2
也就是说,DES-CBC3-SHA在X轴,然后Y坐标是2的historgram,以此类推
不过hist函数只能放numeric在X轴,不知道大家有方法可以做到这样的histogram吗?
谢谢~
[程式范例]:
data <-
read.table("cipherSuite.txt", header = TRUE);
attach(data);
hist(data)
[环境叙述]:
R version 3.2.5 (2016-04-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 LC_CTYPE=Chinese
(Traditional)_Taiwan.950 LC_MONETARY=Chinese (Traditional)_Taiwan.950
[4] LC_NUMERIC=C LC_TIME=Chinese
(Traditional)_Taiwan.950
attached base packages:
[1] stats graphics grDevices utils datasets methods base
[关键字]:
hist histogram
※ 编辑: decken (212.201.79.9), 05/29/2016 03:14:03
作者: andrew43 (讨厌有好心推文后删文者)   2016-05-29 03:48:00
用 barplot() 再加 axis(1, ...) 画上cipher名字
楼主: decken (HAHAHA~)   2016-05-29 06:41:00
画出来了,感谢帮忙 ?1" target="_blank" rel="nofollow">
?1

Links booklink

Contact Us: admin [ a t ] ucptt.com