Introduction to R for Finance!

Report 21 Downloads 83 Views
INTRODUCTION TO R FOR FINANCE

Welcome to Introduction to R for Finance!

Lore Dirick Instructor, DataCamp

Introduction to R for Finance

A Hands-On Course

Introduction to R for Finance

What will you learn? ●

Basics of R



Data structures



Finance examples

Introduction to R for Finance

Console Execute R commands

Introduction to R for Finance

Variables or objects my_number

5

… … … my_number

> my_number my_number [1] 5

5

dan rob dan + rob [1] 150 > total total [1] 150

Introduction to R for Finance

R Scripts !

script.R

dan mult # New Amount > new_cash new_cash 42.5 [1] 42.5 > 5 [1] 5 > 5L [1] 5

Introduction to R for Finance

Character > "Hello world" [1] "Hello world" > "forty" [1] "forty" > "5" [1] "5"

Introduction to R for Finance

Logical > TRUE [1] TRUE > FALSE [1] FALSE > true Error: object 'true' not found > NA [1] NA

Introduction to R for Finance

Variables and data types > my_answer my_answer [1] TRUE > food food [1] "carrots"

Introduction to R for Finance

class() > my_answer class(my_answer) [1] "logical" > class(5) [1] "numeric" > class(5L) [1] "integer"

INTRODUCTION TO R FOR FINANCE

Let’s practice!