Intermediate R for Finance
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
Function | Description |
---|---|
apply | Apply functions over array margins |
lapply | Apply a function over a list or vector |
eapply | Apply a function over values in an environment |
mapply | Apply a function to multiple lists or vector arguments |
rapply | Recursively apply a function to a list |
tapply | Apply a function over a ragged array |
sapply | Simplify the result from lapply |
vapply | Strictly simplify the result from lapply |
Function | Description |
---|---|
apply | Apply functions over array margins |
lapply | Apply a function over a list or vector |
eapply | Apply a function over values in an environment |
mapply | Apply a function to multiple lists or vector arguments |
rapply | Recursively apply a function to a list |
tapply | Apply a function over a ragged array |
sapply | Simplify the result from lapply |
vapply | Strictly simplify the result from lapply |
Function | Description |
---|---|
apply | Apply functions over array margins |
lapply | Apply a function over a list or vector |
eapply | Apply a function over values in an environment |
mapply | Apply a function to multiple lists or vector arguments |
rapply | Recursively apply a function to a list |
tapply | Apply a function over a ragged array |
sapply | Simplify the result from lapply |
vapply | Strictly simplify the result from lapply |
stock_list <- list(stock_name = "Apple", ticker = "AAPL", price = 126.5, good_deal = TRUE)
lapply(stock_list, FUN = class)
$stock_name
"character"
$ticker
"character"
$price
"numeric"
$good_deal
"logical"
$sharpe = \frac{mean(r) - r_f}{sd(r)}$
Intermediate R for Finance