【发布时间】:2018-12-04 14:31:57
【问题描述】:
我想知道如何去除我的 R Shiny 应用程序的文本输出中出现的多余空格。
这是它的编码方式:
output$summary <- renderText ({
isolate({
paste("The power of this independent samples t-test, with population means of",
input$mu_1,"and", input$mu_2,
", standard deviations of", input$sigma_1, "and", input$sigma_2,
", and sample sizes of", input$N_1, "and", input$N_2, ", is", Power)
})
})
Power = mean(out.df$p.value < .05)
Power})
}
然而,在应用程序上,它会显示为:
此独立样本 t 检验的功效为 0.770562770562771,总体均值为 10 和 13,标准差为 2 和 5,样本大小为 21 和 27,
如您所见,逗号之前出现了额外的空格,我想知道如何才能摆脱这些空格?我试过 sep = "" 但这只是将所有数字组合在一起。不确定我是否把它放在正确的地方?
无论如何,提前谢谢!
玛戈
【问题讨论】:
标签: r shiny removing-whitespace