RStudio - Stargazer issue - text table

一笑奈何 提交于 2021-01-29 12:02:04

问题


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")

There is an error message:

*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...) ?

Thank you


回答1:


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:

How to fix 'Error in if (nchar(text.matrix[r, c]) > max.length[real.c]) { : missing value where TRUE/FALSE needed' using stargazer in rstudio?

Please provide str of your dataframe.



来源:https://stackoverflow.com/questions/59908509/rstudio-stargazer-issue-text-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!