在R中显示没有科学符号的数字
我需要以降价方式显示下表:在R中显示没有科学符号的数字,r,format,R,Format,我需要以降价方式显示下表: resumen<-data.frame(dato=c('cant_cli','debit', 'costo_real', 'comis_max', 'pagos', 'comis_real', 'recupero%'), valor= c(nrow(ops), sum
resumen<-data.frame(dato=c('cant_cli','debit', 'costo_real',
'comis_max', 'pagos', 'comis_real',
'recupero%'),
valor=
c(nrow(ops), sum(ops$Debit),sum(ops$costo_real),
sum(ops$comision_max), sum(ops$Amount), sum(ops$comision_ganada),
sum(ops$Amount)/sum(ops$Debit)
))
但我需要有以下格式:
dato valor
cant_cli 62174
debit 3943952
costo_real 26411
comis_max 102148
pagos 2003838
comis_real 51899
recupero% 50.80%
如何使代码使用这种格式?试试这个
as.numeric(resumen[,2])
我假设您希望valor列是数字。但是,在最后一行中,50.80%的用户可以将列转换为字符。这就是你想要的吗?cas.characterroundresumen$valor[-nrowresumen],paste0round100*resumen$valor[nrowresumen],2,%[1]62174 3943952 26411 102148 2003838 51899 50.81%选项SCIPEN=999关闭科学符号这太卑鄙了大卫·阿伦伯格!这是什么意思?David只是改进了你答案的格式。如果你指的是反对票,那就是我。
as.numeric(resumen[,2])