Closed JanaJarecki closed 4 years ago
Hi Jana, thanks for bringing this to my attention. It is indeed not intended behavior and I have just pushed a commit to the development branch. Could you try it out to see if that fixes the issue to you (devtools::install_github("crsh/papaja@devel")
)?
cool thank you :D (integers are weird animals sometimes in R)
I just tried it and the error is gone, however (I am on Windows) the line breaks in the printed table are not printed anymore
library(papaja)
mytable <- data.frame(a=1:3, b=as.integer(c(1,2,NA)))
apa_table(mytable)
[1] "\n\n\n\\begin{table}[tbp]\n\n\\begin{center}\n\\begin{threeparttable}\n\n\\begin{tabular}{ll}\n\\toprule\na & \\multicolumn{1}{c}{b}\\\\\n\\midrule\n1 & 1\\\\\n2 & 2\\\\\n3 & NA\\\\\n\\bottomrule\n\\end{tabular}\n\n\\end{threeparttable}\n\\end{center}\n\n\\end{table}\n\n\n"
attr(,"class")
[1] "knit_asis"
attr(,"knit_cacheable")
[1] NA
This is intended behavior because the returned object is of class knit_asis
. This ensure, that you don't manually need to set results = "asis"
in the chunk option of a chunk in which you call apa_table()
. If you would like to inspect the output with line breaks you should be able to do this using cat()
.
ah, is this new? I seem to remember that differed in earlier versions if I remember correctly
Yes, this is a fairly recent change: https://github.com/crsh/papaja/commit/04869e06f68911db7f4c7a1cb3dc35bfe1b04533
Hi, I love papaja, and I think I found a bug. If there is an integer that contains a
NA
valueapa_table
throws an error.To Reproduce
The expected behavior is like as if it was a numeric (not an integer)
If this is intended behavior, maybe a more informative error message would have helped me out a bit! =)
Cheers Jana
-- SessionInfo()