Installing the tstools package

I created the tstools package to help with some of the rough edges associated with doing time series analysis in R. The package is not available through CRAN, so you won’t find it using install.packages in R.

You need to use the devtools package to install tstools. First install devtools in the usual way:


Once that’s installed, load devtools and call install_bitbucket:


Warning: Do not include the install_bitbucket line in your program.

Doing that will make your program run very slow, because you’ll be downloading and installing the package every time you run your program. You’ll also be wasting lots of bandwidth downloading the package for no reason. Once the package is installed, you don’t need to install it again unless a new version has been released and you want to upgrade to it.

I once had a student tell me he avoided tstools because it made his program run so slow (it took hours to do what should have required at most a few seconds). It turned out that not only was he calling install_bitbucket in his program for no reason, but he was doing it inside a loop. The code on the inside of the loop only took a fraction of a second to run, but it took quite a long time to download and install the package on every iteration of the loop.

Last updated: January 29, 2020

⤺ Back to the List of Computing Posts