Code Snippets
The following code snippets provide quick tutorials on specific tools, datasets, or concepts. The snippets are written in R using a Jupyter Notebook hosted on a cloud environment provided by Google Colab. A Google account is required to connect and run these snippets.
- Install Package and Check Session Info
- If you haven’t already installed the
tswge
package, here’s how to do it and also how to load the library into the runtime and check to see what version of each loaded package is available.
- Plot GPX Data
- In this code snippet, we look at how to read and parse an XML-based GPX data file to extract the timestamps and plot speed against time.
- Reading and Processing Data for Lab 1
- In this code snippet, I show you how to read a non-HTML and HTML plain text file that contain time series data into a time series object in R.
- Save and Load R History
- For assignments (and for your own sake) you can save all the commands you have typed in an R session to a text file, typically called the .Rhistory file. In this code snippet, you will see how to save your history file and load it back into a given session.
Additional Resources
- R Time Series Quick Fix
- This quick fix is meant to expose you to basic R time series capabilities and is rated fun for people ages 8 to 80. This is NOT meant to be a lesson in time series analysis.
- Time Series and Graphics in R
- Examples of plotting time series in R using astsa and ggplot2.