I have made a model in R looking at Wikipedia page views for different birds and plotted it according to various various life history traits.
The model outputs some nice graphs which are useful, but they don't show the individual data points. I would like to be able to see the data points on the graph so that the distribution of them is clear.
This is my first time posting on Stack overflow and I wasn't sure how to make a replicable example, hopefully what I have done below is enough. I didn't want to make the data subset too long so I haven't included all of the columns which I use in my model, but I could if that is necessary to answer the question. I have started with my code and shown the data structure below that.
Thank you.
m2.0_human_sedentary = glm(log_av_total_views ~ log_life_s * human_sett * log_weight_u_m + sedentary,
data = model_totalcount_lifeh)
plot_model(m2.0_human_sedentary, type = "int")
This works nicely, but to try and see the data points I added a function...
plot_model(m2.0_human_sedentary, type = "int", show.data = TRUE)
Which works on 3/4 of the plots, but messes up the last one, which happens to be the one I'm most interested in. There is no error, but the output doesn't even resemble a graph.
model_totalcount_lifeh <-
structure(
list(
title = c(
"Peregrine falcon",
"Golden eagle",
"Osprey",
"Common raven",
"Mallard"
),
category.x = structure(
c(1L,
1L, 1L, 1L, 1L),
levels = c("LC", "NT", "VU"),
class = "factor"
),
av_total_views = c(
69717.4912280702,
53478.4210526316,
49867.9473684211,
39600.8245614035,
33459.8771929825
),
av_summer_views = c(
78226.962962963,
54020.7777777778,
58687.5925925926,
46819.7037037037,
36948.7777777778
),
Wing = c(332.5, 626, 482, 421.4, 272),
life_s = c(17,
32, 27, 23, 23)
),
class = c("grouped_df", "tbl_df", "tbl",
"data.frame"),
row.names = c(NA,-5L),
groups = structure(
list(
title = c(
"Common raven",
"Golden eagle",
"Mallard",
"Osprey",
"Peregrine falcon"
),
.rows = structure(
list(4L, 2L, 5L, 3L,
1L),
ptype = integer(0),
class = c("vctrs_list_of", "vctrs_vctr",
"list")
)
),
class = c("tbl_df", "tbl", "data.frame"),
row.names = c(NA,-5L),
.drop = TRUE
)
)