例如,我有数字:43.2, 45.3, 48.1, 54.2.当我使用stem()函数绘制一个图时,我得到这个:stem()函数显示如下
x <- c(43.2, 45.3, 48.1, 54.2)
stem(x)
#
# The decimal point is 1 digit(s) to the right of the |
#
# 4 | 3
# 4 | 58
# 5 | 4
Run Code Online (Sandbox Code Playgroud)
但从情节来看,我只知道数字是:43,45,48,54.所以我想要一个函数绘制一个茎叶图,我仍然可以知道确切的数字而不用向上舍入.
此外,我希望它只使用一个数字来表示词干,同时在叶子中显示其他.例如,43.2应该是茎4和叶3.2,43.22应该是茎4和叶3.22.对于数字:43.2, 45.3, 48.1, 54.2.我想要这样的情节: