-
-
Save mribeirodantas/67e7027faa9b542c043d34f00893d59c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> A <- c(1,1,1,1,1,1,1,1,8,10) | |
> B <- c(1,2,3,4,5,6,7,8,9,10) | |
> growth_rate(A) | |
[1] NA 0 0 0 0 0 0 0 700 25 | |
> sum(growth_rate(A), na.rm=TRUE)/length(A) | |
[1] 72.5 | |
> | |
> growth_rate(B) | |
[1] NA 100.00000 50.00000 33.33333 25.00000 20.00000 16.66667 14.28571 12.50000 | |
[10] 11.11111 | |
> sum(growth_rate(B), na.rm=TRUE)/length(B) | |
[1] 28.28968 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment