vis_miss make column titles vertical

1.5k views Asked by At

how do you rotate the column titles in vis_miss (naniar library)? They are tilted in the default settings, I would like the titles to be vertical (parallel to the y-axis of the graph). Thanks for your help!

2

There are 2 answers

2
Nick Tierney On

The current behaviour of vis_miss() is the following:

library(visdat)
vis_miss(airquality)

Created on 2018-11-04 by the reprex package (v0.2.1)

As visdat is built on top of ggplot2, you rotate the y axis labels 90 degrees, like so:

library(visdat)
library(ggplot2)

vis_miss(airquality) + 
  theme(axis.text.y = element_text(angle = 90))

Created on 2018-11-04 by the reprex package (v0.2.1)

Which I found from this: Rotating and spacing axis labels in ggplot2

0
ibm On

theme(axis.text.x = element_text(angle = 90)) or whatever other angle degree instead of axis.text.y to change the variable labels on top.