Formatted table output, printing into R console

Deadly 提交于 2019-12-04 10:00:56

Something like this?

require(knitr)

for(i in 1:2){
  #some calculation 
  x<-runif(runif(1,1,5))
  y<-length(x)

  #dataframe output
  df <- cbind(x,y)

  #pretty table
  print(kable(df))
}


#output
#   |         x|  y|
#   |---------:|--:|
#   | 0.4872941|  3|
#   | 0.8014921|  3|
#   | 0.7023384|  3|
#   
#   
#   |         x|  y|
#   |---------:|--:|
#   | 0.9214315|  4|
#   | 0.7119830|  4|
#   | 0.0354769|  4|
#   | 0.1049139|  4|
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!