0

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

Marco
  • 2,368
  • 6
  • 22
  • 48
Pierre PL
  • 1
  • 1

1 Answers1

0

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

enter image description here

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.

Marco
  • 2,368
  • 6
  • 22
  • 48