Skip to content

Plotting a date variable after GAM

3 messages · Shige Song, Jean V Adams

#
Dear All,

I am fitting a simple GAM model using the "gam" function in the "mgcv"
package. The only independent variable is a continuous variable
representing the time of the event (in year and month) coded so that
"0" represents January 1960, "1" represents February 1960, etc. Now
when I try to plot the results, my x-axis ranges from "-200" to "200",
what I want is to convert these number into something like "1950-01"
or "Jan. 1950". What is the best way to do this?

Many thanks.

Best,
Shige
#
Dear Jean,

That is a simple and effective solution. Thank you!

Best,
Shige
On Tue, Dec 13, 2011 at 4:16 PM, Jean V Adams <jvadams at usgs.gov> wrote: