Book Image

Learning R for Geospatial Analysis

By : Michael Dorman
Book Image

Learning R for Geospatial Analysis

By: Michael Dorman

Overview of this book

Table of Contents (18 chapters)
Learning R for Geospatial Analysis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
External Datasets Used in Examples
Cited References
Index

Working with dates and time series


In this section, we'll cover a concept closely related to vectors—time series. A time series is a sequence of values, each associated with a time index. For convenience, the values are usually ordered from the earliest to latest. The time difference between consecutive time indices can be fixed (in which case we have a regular time series) or variable (in which case we have an irregular time series), although an irregular time series can also be considered as a regular time series with missing data. For example, daily rainfall amounts in New York or Dollar to Euro currency exchange rates for the period of January 1, 2014 to January 15, 2014 would comprise two different time series.

Following its definition, the simplest way to represent a time series would be to have a separate vector of data values and a separate vector of time, with the same length, with each element of the data values vector corresponding to the respective element in the time vector....