How to compute annualized return of a stock with tidyverse

In this tutorial, we will learn how to compute annualized return of stock using tidyverse from scratch. Annualized return of an investment is the average returns of the investment that is held over many years. In comparison to simple mean of yearly returns, annualized return is a geometric mean and it accounts for the compounding… Continue reading How to compute annualized return of a stock with tidyverse

How to get product of all elements in a column

In this tutorial we will learn how to compute product of all elements of a column in a dataframe using tidyverse. We will use prod() function in base to multiple all elements of a columns. Let us first load tidyverse. We will create a simple dataframe using tidyverse’ tibble() with a column containing numbers from… Continue reading How to get product of all elements in a column

Exit mobile version