3

Data exempel:

lme1<- lme(total.fruits ~ rack + nutrient + amd + status,
            random = ~1|reg, method = "ML", data=Arabidopsis)

How can I know save the output of the tab_model() function below? The tab_model() function is part of the sjPlot package. There has to be a nother way than to take a screenshot or?

tab_model(lme1)

enter image description here

2
  • Can you add a little bit more information about your goal? Do you want to work with the information programmatically? Embed in a document (what format? Word file?) Functions like broom.mixed::tidy() can also capture info
    – Ben Bolker
    Commented Apr 27, 2021 at 14:09
  • I just like to save the table as pdf or something similar.
    – Matthew
    Commented Apr 28, 2021 at 6:44

2 Answers 2

11
  1. You could use webshot package:

  2. With file option first save an .html file

  3. Then use webshot to make a .png file

See my example with mtcars:

library(nlme)
library(sjPlot)
library(webshot)
lme1<- lme(mpg ~ cyl +  disp + hp,
           random = ~1|disp, method = "ML", data=mtcars)

# first save table to html file
tab_model(lme1, file = "plot.html")

# then take this html file and make .png file
webshot("plot.html", "plot.png")
0
10

you can write the following:

library(sjPlot)
tab_model(lme1, file = "YOURTABLENAME.doc")

#lme1 can be any model

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jan 2, 2022 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.