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/

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s