Pulling data from Quandl with R

The following R codes would pull the U.S. Treasury yields from Quandl and make the chart below.

#Treasury Yield

Treasury=Quandl(“USTREASURY/REALYIELD”)

ggplot(Treasury,aes(x=Date))+geom_line(aes(y=Treasury$`5 YR`, Color=”5 Year”)) +

geom_line(aes(y=Treasury$`10 YR`, color=”10 Year”))+
geom_line(aes(y=Treasury$`20 YR`, color=”20 Year”))

Rplot01

Source: https://www.quandl.com/