I'm using ggfortify
to draw some diagnostic plots for my lm
and glm
objects, but I can't figure out how to specify the labels to use. Right now, it uses the observation numbers. I'd rather it use a column named "community" in df.ca
for the label names.
The GLM example here shows text like I'm looking to do, and I can't see any different specifications under label.label
or anything similar.
Here's my data in RDS format. The dataframe is 77x202 so I haven't copied it here.
Here's the code that specifies the model and then plots:
summary(m.ca.ppc <- lm(ppc ~ medinc + hisp + black + asian, data = df.ca))
autoplot(m.ca.ppc, which = 1:6, ncol = 3, label.size = 3)
My questions are:
[edited to clarify after questions in the comments]
您必须激活文本标签,指向相关列,然后关闭点。
autoplot(m.ca.ppc, data = df.ca, label.size = 3, label=TRUE, label.label="community", shape=FALSE, which=1:6, ncol=3)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.