spect                  package:Rsac                  R Documentation

_S_P_E_C_T_R_A_L _D_E_N_S_I_T_Y _E_S_T_I_M_A_T_I_O_N

_D_e_s_c_r_i_p_t_i_o_n:

     This is essentially a wrapper function for 'spectrum' from the
     'stats' package. Thus, it is important the user be familiar with
     the documentation of the functions listed in the See Also
     section. This is simply a quick way to compute the spectra of
     '"rsac"' class objects.

_U_s_a_g_e:

     spect(x, plot = TRUE, main = NULL, log = "no", ...)

_A_r_g_u_m_e_n_t_s:

       x: an object of class '"rsac"'.

    plot: logical for if the spectrum should be plotted.

    main: optional character vector for the plots' titles. If not
          provided, the code creates the character vector from the
          station, component, and network in the header files, but
          these are not always reliable. The length of the vector must
          equal the length of 'x'.

     log: See 'plot.spec'.

     ...: further parameters. See 'spectrum' and 'plot.spec'.

_V_a_l_u_e:

     a vector of objects, each object is of '"rsac"'.

_A_u_t_h_o_r(_s):

     Eric M. Thompson <eric.thompson@tufts.edu>

_S_e_e _A_l_s_o:

     'spectrum', 'plot.spec', 'spec.pgram', 'spec.ar'

_E_x_a_m_p_l_e_s:

     data(srosa)
     data(sumatra)

     eqs <- c(srosa[1], sumatra[11])

     spect(eqs)

     spect(eqs, spans = 101)

     spect(eqs, spans = 201)

     spect(eqs, spans = c(101, 151))

     spect(eqs, spans = c(101, 151),
           log = "yes")

     getdelta <- function(X){
       delta <- gcp(s = list(lat = X$stla, lon = X$stlo),
                    e = list(lat = X$evla, lon = X$evlo))$a}
     del <- sapply(X = sumatra, getdelta)

     sum <- sumatra[c(1, 3, 4, 9)]

     spect(sum, plot = TRUE, spans = c(101, 151),
           log = "no", xlim = c(0, 0.15))

