我尝试使用\u2264对于小于或等号:
> names(table_A1) <- c("x", "P(X=x)", "P(X\u2264x)")
> print(table_A1)
但这出现在输出中:
> x P(X=x) **P(X=x)**
> 1 2 0.562 0.563
> 2 3 0.281 0.844
> 3 4 0.105 0.949
> 4 5 0.035 0.984
> ...
如果我单击查看表,则会出现:
> x P(X=x) **P(X≤x)**
> 1 2 0.562 0.563
> 2 3 0.281 0.844
> 3 4 0.105 0.949
> ...
还有其他方法可以打印此标志吗?
按照要求:
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1 yaml_2.2.0
colnames(mtcars)[1] <- as.character(expression("P(X\u2264x)"))
head(mtcars[,1:3])
## P(X≤x) cyl disp
## Mazda RX4 21.0 6 160
## Mazda RX4 Wag 21.0 6 160
## Datsun 710 22.8 4 108
## Hornet 4 Drive 21.4 6 258
## Hornet Sportabout 18.7 8 360
## Valiant 18.1 6 225
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)