missing value where TRUE/FALSE needed after tablestack


I´m using this command in RMarkdown to generate a descriptive table, but I keep getting this error:

Error in if (xi > xj) 1L else -1L : missing value where TRUE/FALSE needed.

This is happening after I run this command:

tableStack(vars =1:11, dataFrame=ovario2, by=cirurgia, percent = "row" )

Could anyone help me to see the obstacle here, please?

Thanks in advance.


Hi @kikofurtado,
Welcome to the RStudio Community Forum.

In order to diagnose this problem you will need to present some of your data (the data frame ovario2), plus the full code that generated the message. This is called a "reproducible example" (reprex) -- see the posting guide at the top of this forum for information on how to make a simple reprex. Its also worth checking that this error occurs using both a plain R script file, as well as your Rmarkdown script.

I see that a function called tableStack() is available in two CRAN packages -- including your library() call shows us which one you are using.

Its also useful to show the output of sessionInfo() so that we can see what scenario you are operating under.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.