How to insert year by year into a time series graph in ggplot?

Asked

Viewed 42 times

0

I’m running the remote

ggplot(Regulation, aes(Regulation$year, Regulation$rqe)) +
geom_line() +

geom_point(Colour = "blue")+

Labs(title = "REGULATORY QUALITY ESTIMATOR (1996-2017)", x = "YEAR", y = "REGULATORY QUALITY", caption = "Own elaboration from Worldwilde Governance Indicators data") and the graph comes out as follows

inserir a descrição da imagem aqui

The data range from 1996 to 2017 year to year but only runs every five years. I’ve tried several options to shape the data but none of them work. Someone would know how to solve?

1 answer

0

Consider plotting the year as a factor:

ggplot(regulation, aes(factor(regulation$year), regulation$rqe)) + ...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.