Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 单元格中带间隔的表_R_Tabular - Fatal编程技术网

R 单元格中带间隔的表

R 单元格中带间隔的表,r,tabular,R,Tabular,我试图将统计数据的一些置信区间拟合到一个表中,但是这个结构对我来说很复杂。我希望它看起来像这样 水平仪 百分位 学生的 95% [p1,p2] [t1,t2] 您可以使用sprintf和toString来格式化表格 A <- data.frame(level = '95%', Percentile = sprintf('[%s]', toString(round(boot.t, 3))), Student = sprin

我试图将统计数据的一些置信区间拟合到一个表中,但是这个结构对我来说很复杂。我希望它看起来像这样

水平仪 百分位 学生的 95% [p1,p2] [t1,t2]
您可以使用
sprintf
toString
来格式化表格

A <- data.frame(level = '95%', 
                Percentile = sprintf('[%s]', toString(round(boot.t, 3))), 
                 Student = sprintf('[%s]', toString(round(boot.p, 3))))
A

#  level     Percentile        Student
#1   95% [1.004, 1.154] [1.001, 1.149]

A正是我需要的,谢谢你的帮助。标记为已解决。