Identify seasonality in time series data I want to detect presence of seasonality in time series data. I know one can achieve that by plotting the autocorrelation function but I need an automatic process if the series is seasonal or not, more like an algorithm that after I run the time series thought I get 'YES' for seasonal and 'NO' for nonseasonal.
Is there anything in R that I can use? 
If not what is a way by knowing the autocorrelation function (ACF) to do this?
Thanks   
 A: The trouble with using the ACF is that there can be other reasons for significant spikes, not just seasonality. So it is indicative but cannot be conclusive.
If the data had a small seasonal period (such as 4 for quarterly data or 12 for monthly data) then a simple approach is to use the ets function in the forecast package for R. If there is a seasonal pattern, it will choose a seasonal model.
But since your data are weekly (according to the comments in the answer from Mark T Patterson), that won't work because the seasonal period is too long, and because it is non-integer. X12 also won't help you (as suggested by @toomuchpj) as it is only designed for quarterly and monthly data.
The non-integer period will be a problem for any solution that assumes period=52, because the difference between 52 and 365/7 will become apparent with long series.
One approach is to use the tbats model, also in the forecast package in R. It will handle weekly seasonality and will automatically determine if a seasonal pattern is present. For example:
x <- ts(data, frequency=365/7)
fit <- tbats(x)
seasonal <- !is.null(fit$seasonal)

Then seasonal will be TRUE if a seasonal model is chosen and otherwise FALSE.
A: @Eva,
I definitely think R has the functionality to help you out here.  The decision about which tool depends a bit on the kind of seasonality you're trying to detect -- can you tell us a bit more about the data you're modeling?
I would start with something simple -- for example, let's assume you have a single observation each day for 1000 days, and are interested in whether there's an effect of month.
You could start by writing a function that fits a model of your outcome variable on month (as a factor), and then reports a 1 if any of your months are significant at the 1% level.  Note: be very careful about multiple hypothesis tests here..
Here's some example code, using a DV which we expect not to exhibit seasonality:
time = seq(from = 1, by = 1, length.out = 1000)
month = time %% 12

y = rnorm(1000,0,1)

df = data.frame(time, month, y)

seasonality.func = function(df){
  lm.1 = lm(y ~ factor(month), data = df)
  p.vals = summary(lm.1)$coefficients[,4]
  p.vals.lt.01 = as.numeric(sum(p.vals<.01)>0)
  return(p.vals.lt.01)
}

seasonality.func(df)

