RStudio - Stargazer 问题 - 文本表 [英] RStudio - Stargazer issue - text table

查看:89
本文介绍了RStudio - Stargazer 问题 - 文本表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在学习 RStudio(初学者级别),我有一个关于 stargazer 函数的问题,尤其是如何创建描述性统计表.我确实首先上传了我的数据集(称为 d)和所有相关的库,如 stargazer.我确实运行了命令行:

I am currently learning RStudio (beginner level) and I have a question regarding stargazer function and especially how to create the table of descriptive statistics. I did start by updloading my dataset (called d) and all relevant libraries like stargazer. I did run command line:

stargazer(d, type = 'text', title = "Statistiques descriptives",digits = 1, out="table1.txt")

有一条错误信息:

*Error in if (nchar(text.matrix[r, c]) > max.length[real.c]) { : 
  missing value where TRUE / FALSE is required*

如何用相关信息(平均值、标准差...)填写表格?

How can I complete the table with relevant information (mean, standard deviation...) ?

谢谢

推荐答案

尝试更详细地描述您的数据.如果可能,请提供一个最小的工作示例.该命令原则上没问题:

Try to describe your data more in detail. Provide a minimal working example, if possible. The command is fine in principle:

library(stargazer)

stargazer(mtcars, type = 'text', title = "Statistiques descriptives",digits = 1, out="table1.txt")

同样的问题与变量名中的下划线有关:

Same issue was related to underscore in variable names:

如何修复'如果 (nchar(text.matrix[r, c]) > max.length[real.c]) { : 在需要 TRUE/FALSE 的地方缺少值'在 rstudio 中使用 stargazer 时出错?

请提供数据帧的str.

这篇关于RStudio - Stargazer 问题 - 文本表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆