ABSTRACT

The objective of this book is for the reader to learn the theory of finance using the R language, which is a programming language developed specifically for numerical calculation. The first chapter is devoted to introducing R, its installation and basic usage. We first introduce the basic structure of the language and operators, such as arithmetic, comparative and logical operators. Next, we introduce the definition and usage of the R data structures, including scalar, vector, matrix, list, data frame and factor. Further, we demonstrate the usage of functions and control statement, which are essential to writing scripts in R. We also discuss the reading and writing of files with R, and how to display graphics for data visualization. Finally, we introduce the usage of packages in R, which are extensions to its functionality.