如何格式化在 r 中的 quantmod 包中使用 Delt 函数的结果

How to format the result from using Delt function in quantmod package in r

我在 R 中使用 quantmod 包中的 Delt 函数得到了很好的结果。 但是,结果的格式并不像我想要的那样安静。它类似于 -0.046984753。如果有意义的话,我希望这个数字是 -4.7%!

求助高手!!

谢谢!

使用scales

 library('scales')
 result=-0.046984753
 percent(result)
 [1] "-4.7%"