October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps in R:
> head(my_series) Output: Jan Feb Mar Apr May Jun 2011 2888 3894 3675 3113 3421 3870 > tail(my_series) Output: Jul Aug Sep Oct Nov Dec 2016 3203 3329 3854 3285 3800 2563 > tail(my_series, 20) Output: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 2015 3881 3983 3813 3172 2667 3517 3445 2805 2016 3668 3948 2779 2881 3285 2733 3203 3329 3854 3285 3800 2563 > head(my_series,5) Output: Jan Feb Mar Apr May 2011 2888 3894 3675 3113 3421 > require(xts) > first(my_series) Output: [1] 2888 > last(my_series) Output: [1] 2563 > first(my_series, "3 months") Output: [1] 2888 3894 3675 > first(my_series, "3 years") Output: [1] 2888 3894 3675 3113 3421 3870 2644 2677 3392 2847 2543 3147 2973 3538 3632 2695 ...
Read now
Unlock full access