[R] Some basic time series questions

Hall, Mark mehall at blm.gov
Wed Nov 16 19:19:16 CET 2016


Hi,

As I sit and learn how to work with time series, I've run into a problem
that is eluding a quick easy answer (and googling for answers seems to
really slow the process...)

Question #1--
In a simple example on R 3.3.1 (sorry my employer hasn't upgraded to 3.3.2
yet):

x=rnorm(26,0,1)
x.ts<-ts(x,start=c(2014,9),frequency=12)

inputting x.ts at the prompt gives me a table with the rooms denoted by
year and columns denoted by months and everything lines up wonderfully.

Now my problem comes when I type at the prompt

plot(x.ts)  or
plot(x.ts, xlab="") or
plot.ts(x.ts,xlab="")

I get a plot of the values, but my x-axis labels are 2015.0, 2015.5,
2016.0, and 2016.5 .  January 2015 is coming out as 2015.0...

Is there a way of getting a more intelligible x-axis labeling?  Even 2015.1
for Janaury, etc. would work, or even getting an index (either Septemebr
2014 representing 0 or 1 and it incrementally increasing each month).

Question #2--
If I have a time series of decadal events, how best should I set the
frequency.  It is historical data, in the form of say AD 610-619 5 events,
AD 620-629 7 events, etc.

Sorry for such a basic questions.  Any advice would be appreciated.

Thanks in advance, MEH



Mark E. Hall, PhD
Assistant Field Manager
Black Rock Field Office
Winnemucca District Office
775-623-1529.

	[[alternative HTML version deleted]]



More information about the R-help mailing list