Skip to Content
Basic Data Analysis for Time Series with R
book

Basic Data Analysis for Time Series with R

by DeWayne Derryberry
July 2014
Intermediate to advanced
320 pages
8h 11m
English
Wiley
Content preview from Basic Data Analysis for Time Series with R

1 R BASICS

1.1 GETTING STARTED

Programming, writing code, is an integral part of modern data analysis. This book assumes some experience with a programming language. R is simply a high level programming language with several functions that perform specialized statistical analysis. Any R programmer may also write their own functions, but the focus of this book is using functions already in R and writing some basic code using these functions.

In this book, R code is always shaded. Related R output that follows is always underlined or, if extensive, presented in a table. Comments in R code follow the pound sign, #. When R functions are discussed in the text, they will be italicized.

images

FIGURE 1.1 An example of a plot in R.

Some basic statistical analysis might involve inputting some values and performing some basic statistical analysis. Following the conventions already stated,

# this is a comment
x <- c(0.1,1.1,2.3,4.1, 5.6, 8.3) # create a vector of 6 values, these were just made up
y <- c(8.7, 6.5, 3.1, 3.3, −1.1, −0.9) #create a second vector
plot(x,y,xlab = “this places a label on the x axis”, ylab = “this labels the y axis”)
title(“this is a demo”)
# either “<-” or “=” can be used for assignments, but “<-” makes more sense.
# The reader should be aware that “=” and “<-” are not always interchangeable in R

(Figure 1.1).

The R code produces the data plotted in Figure 1.1 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Advanced Time Series Data Analysis

Advanced Time Series Data Analysis

I. Gusti Ngurah Agung
Regression Analysis with R

Regression Analysis with R

Giuseppe Ciaburro, Pierre Paquay, Manoj Kumar, Shaikh Salamatullah

Publisher Resources

ISBN: 9781118593363Purchase bookOther