R:将data.frame的某些单元格更改为粗体

时间:2015-02-23 12:14:45

标签: r

我已经找了一段时间,但无法找到我的问题的答案:如何编辑data.frame的特定单元格为粗体或斜体或其他什么?

我有一个名为corHighViewSOI的相关矩阵(见下文),并希望将最高的6个条目转换为粗体。

row.names    Jan        Feb        Mar         Apr         May         Jun         Jul         Aug         Sep         Oct         Nov         Dec
1   Jan 1.00000000  0.56691659  0.5768323   0.4576408   0.03780489  0.15176883  0.05791961  -0.07543212 -0.11203950 0.07805176  0.06893252  -0.06780511
2   Feb 0.56691659  1.00000000  0.5505371   0.4271174   0.06137921  0.04427556  0.04681803  0.10396901  0.01804741  0.10406845  0.09379290  0.02160785
3   Mar 0.57683233  0.55053712  1.0000000   0.5767771   0.18408866  0.23747621  0.15080239  0.18517667  0.20887256  0.28660763  0.22042098  0.20300788
4   Apr 0.45764084  0.42711743  0.5767771   1.0000000   0.38408853  0.26066824  0.38564495  0.35326341  0.38841728  0.37860488  0.26967989  0.29615529
5   May 0.03780489  0.06137921  0.1840887   0.3840885   1.00000000  0.53754314  0.52842071  0.57477819  0.56916596  0.48388783  0.29378609  0.45386730
6   Jun 0.15176883  0.04427556  0.2374762   0.2606682   0.53754314  1.00000000  0.71967821  0.57044572  0.60215610  0.62047854  0.39541672  0.53483997
7   Jul 0.05791961  0.04681803  0.1508024   0.3856450   0.52842071  0.71967821  1.00000000  0.76574102  0.73829198  0.66729781  0.45893665  0.60664549
8   Aug -0.07543212 0.10396901  0.1851767   0.3532634   0.57477819  0.57044572  0.76574102  1.00000000  0.84522485  0.66523923  0.54960411  0.64963081
9   Sep -0.11203950 0.01804741  0.2088726   0.3884173   0.56916596  0.60215610  0.73829198  0.84522485  1.00000000  0.74064734  0.62288570  0.70391806
10  Oct 0.07805176  0.10406845  0.2866076   0.3786049   0.48388783  0.62047854  0.66729781  0.66523923  0.74064734  1.00000000  0.64529608  0.65560997
11  Nov 0.06893252  0.09379290  0.2204210   0.2696799   0.29378609  0.39541672  0.45893665  0.54960411  0.62288570  0.64529608  1.00000000  0.64267924
12  Dec -0.06780511 0.02160785  0.2030079   0.2961553   0.45386730  0.53483997  0.60664549  0.64963081  0.70391806  0.65560997  0.64267924  1.00000000

我可以使用

隔离最高分
corHighViewSOI[!1:l %in% corHighSOI] <- NA

NA替换除最高6之外的所有值,但这不是很漂亮,所以更喜欢以粗体突出显示最高的6。

有人有建议吗?谢谢你的到来。

0 个答案:

没有答案