问题
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