Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding arsenal tables to jamovi #298

Closed
sbalci opened this issue Jun 18, 2020 · 4 comments
Closed

adding arsenal tables to jamovi #298

sbalci opened this issue Jun 18, 2020 · 4 comments

Comments

@sbalci
Copy link

sbalci commented Jun 18, 2020

Dear developers,
I am trying to add arsenal tables into jamovi in the ClinicoPath module.

Users are informed that arsenal package is used and citation is given with each analysis. I would like to ask your help regarding pfootnotes.

  • Screenshots of output:

Ekran Resmi 2020-06-18 13 26 17

Ekran Resmi 2020-06-18 13 26 43

  • The code I use is:
                tablearsenal <- arsenal::tableby(formula = formula,
                                                 data = mydata,
                                                 total = TRUE,
                                                 digits = 1,
                                                 digits.count = 1
                )

                tablearsenal <- summary(tablearsenal,
                                        text = 'html',
                                        pfootnote = TRUE
                                        )


                tablearsenal <-
                    kableExtra::kable(tablearsenal,
                                      format = "html",
                                      digits = 1,
                                      escape = FALSE
                                      )
  • My issue is that: Although I use pfootnote = TRUE I could not get it work with kable. The output does not give test names.

  • I assume since the names of tests are outside </table>, the kable function does not return them in the output.
    The summary produces following:

   <td style="text-align:center;"> 122 (49.2%) </td>
   <td style="text-align:right;">  </td>
  </tr>
</tbody>
</table>
1. Linear Model ANOVA
2. Pearson's Chi-squared test

As a note I tried other output options but I could avoid &nbsp; blank spaces only with kable.

Would you please guide me in adding the test names to the output?

Best wishes and thank you for the package.

@eheinzen
Copy link
Collaborator

Try this:

summary(tableby(sex ~ age + arm, data = mockstudy), text = "html", pfootnote = "html")

Does that work?

@sbalci
Copy link
Author

sbalci commented Jun 26, 2020

Thank you.

Now, the footnote is html tagged. However since it is below </table> it is still not added to table output.

In R markdown the results are also separated. Table is in knit_asis part, the footnote is in R Console part.

Is it possible to combine these two summary outputs, the knit_asis part and console part?

Is there any method to do this with R I can try for my case.

Best wishes

...
  </tr>
</tbody>
</table>
<ol>
<li>Linear Model ANOVA</li>
<li>Pearson's Chi-squared test</li>
</ol>

Ekran Resmi 2020-06-26 16 12 23

@sbalci
Copy link
Author

sbalci commented Jun 26, 2020

Using capture.output()I have managed to make it work.
Thank you for your time.

Ekran Resmi 2020-06-26 18 17 05

@eheinzen
Copy link
Collaborator

Oh yes--sorry! I should've mentioned that you'd probably need capture.output()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants