Load the necessary library called ‘tidyverse’. Do not be alarmed with a conflict detection notification, only if you see the word ‘error’ should you attend to the message.
The goal is to test your software installation, to demonstrate
competency in being able to write text intermixed with code inside an
Rmd file, and competency in the basics of the library
ggplot.
I encourage the use of ‘ChatGPT’ where you feel it can help you. Imagine it as your useful assistant.
You should have already successfully installed R and R studio in your computer. If in doubt please follow the pdf which I have created for you called ‘Introduction to R and RStudio’.
tidyverse packageThe basic installation of R is known as base R. (If
you haven’t already done so) we need to install a package called
tidyverse. Go to the packages panel in the bottom right of
RStudio, click on “Install,” type tidyverse, and press
enter. You’ll see output in the RStudio console as all the package
contents are installed. Do not be alarmed by red text, only if you see
the word ‘error’.
Written assignments will be submitted using Markdown.
Markdown is a lightweight text formatting language that easily converts
between file formats. It is integrated directly into R Markdown, which combines R
code, output, and written text into a single document
(.Rmd).
There is a very nice Markdwown tutorial that I suggest you go through before working on your assignment.
Pandocis a program that converts Markdown files into basically anything else. It was created by John MacFarlane, a philosophy professor at the University of California, Berkeley and is widely used as a writing tool and as a basis for publishing workflow. Kieran Healy’s Plain Text Social Science workflow describes how to use Markdown and then convert your Markdown document to HTML, PDF, word, etc.
You should create a file whose name will be your
Name_Surname.Rmd.
You should write within this Rmd file a brief biography of yourself using markdown syntax. I know you have already achieved a lot, but a couple of paragraphs is more than enough.
You are recommended including at least 4 of the following elements:
Please write your short biography after this blockquote.
##Biography of Shaz Ali## I am from the UK, and I studied at the University of Bristol prior to joining London Business School. This is how I feel right now when doing this task I Hope To Learn A Lot From This Course!:D
library(ggplot2)
library(readr)
library(dplyr)
bond_10yr <- read_csv(“C:/Users/Shahzaib
Ali/Desktop/Desktop/2024-25/London Business School/Masters in Financial
Analysis 2024-25/Data
Analytics/Pre-work/pre_programme_assignment/pre_programme_assignment/Data/BOND_TY10_US.csv”)
glimpse(bond_10yr) head(bond_10yr, 20)
data_2001_2010 <- bond_10yr %>% filter(Date >= “2001-01-01” & Date < “2011-01-01”)
data_2011_2020 <- bond_10yr %>% filter(Date >= “2011-01-01” & Date < “2021-01-01”)
data_2001_2010\(Date <- as.Date(data_2001_2010\)Date) data_2011_2020\(Date <- as.Date(data_2011_2020\)Date)
ggplot(data = data_2001_2010, aes(x = Date, y = BOND_TY10_US)) + geom_line(color = “blue”) + labs(title = “US 10-Year Treasury Bond Yields (2001-2010)”, x = “Date”, y = “Market Yield (%)”) + theme_minimal()
ggplot(data = data_2011_2020, aes(x = Date, y = BOND_TY10_US)) + geom_line(color = “red”) + labs(title = “US 10-Year Treasury Bond Yields (2011-2020)”, x = “Date”, y = “Market Yield (%)”) + theme_minimal()
If you want to, please answer the following