title: R - exclamation mark before variable, but no subsequent =, == or similar
body: <p>The code for the Holt-Winters function in R contains the following if clause: </p>
  
  <pre><code>if (!is.null(gamma) &amp;&amp; is.logical(gamma) &amp;&amp; !gamma)
  </code></pre>
  
  <p>Obviously the first means "if NOT gamma is Null".  I am a bit confused by the meaning of the third - it looks like this reads, "if NOT gamma", but there is nothing following like an equals sign or an is.null, etc.  </p>
  
  <p>Forgive me if this is a somewhat basic question, but I am very new to R. </p>
  
  <p>Full code: </p>
  
  <pre><code>{
  x &lt;- as.ts(x)
  seasonal &lt;- match.arg(seasonal)
  f &lt;- frequency(x)
  if (!is.null(alpha) &amp;&amp; (alpha == 0)) 
      stop("cannot fit models without level ('alpha' must not be 0 or FALSE)")
  if (!all(is.null(c(alpha, beta, gamma))) &amp;&amp; any(c(alpha, 
      beta, gamma) &lt; 0 || c(alpha, beta, gamma) &gt; 1)) 
      stop("'alpha', 'beta' and 'gamma' must be within the unit interval")
  if ((is.null(gamma) || gamma &gt; 0)) {
      if (seasonal == "multiplicative" &amp;&amp; any(x == 0)) 
          stop("data must be non-zero for multiplicative Holt-Winters")
      if (start.periods &lt; 2) 
          stop("need at least 2 periods to compute seasonal start values")
  }
  if (!is.null(gamma) &amp;&amp; is.logical(gamma) &amp;&amp; !gamma) {
      expsmooth &lt;- !is.null(beta) &amp;&amp; is.logical(beta) &amp;&amp; !beta
      if (is.null(l.start)) 
          l.start &lt;- if (expsmooth) 
              x[1L]
          else x[2L]
      if (is.null(b.start)) 
          if (is.null(beta) || !is.logical(beta) || beta) 
              b.start &lt;- x[2L] - x[1L]
      start.time &lt;- 3 - expsmooth
      s.start &lt;- 0
  }
  else {
      start.time &lt;- f + 1
      wind &lt;- start.periods * f
      st &lt;- decompose(ts(x[1L:wind], start = start(x), frequency = f), 
          seasonal)
      if (is.null(l.start) || is.null(b.start)) {
          dat &lt;- na.omit(st$trend)
          cf &lt;- coef(.lm.fit(x = cbind(1, seq_along(dat)), 
              y = dat))
          if (is.null(l.start)) 
              l.start &lt;- cf[1L]
          if (is.null(b.start)) 
              b.start &lt;- cf[2L]
      }
      if (is.null(s.start)) 
          s.start &lt;- st$figure
  }
  lenx &lt;- as.integer(length(x))
  if (is.na(lenx)) 
      stop("invalid length(x)")
  len &lt;- lenx - start.time + 1
  hw &lt;- function(alpha, beta, gamma) .C(C_HoltWinters, as.double(x), 
      lenx, as.double(max(min(alpha, 1), 0)), as.double(max(min(beta, 
          1), 0)), as.double(max(min(gamma, 1), 0)), as.integer(start.time), 
      as.integer(!+(seasonal == "multiplicative")), as.integer(f), 
      as.integer(!is.logical(beta) || beta), as.integer(!is.logical(gamma) || 
          gamma), a = as.double(l.start), b = as.double(b.start), 
      s = as.double(s.start), SSE = as.double(0), level = double(len + 
          1L), trend = double(len + 1L), seasonal = double(len + 
          f))
  if (is.null(gamma)) {
      if (is.null(alpha)) {
          if (is.null(beta)) {
              error &lt;- function(p) hw(p[1L], p[2L], p[3L])$SSE
              sol &lt;- optim(optim.start, error, method = "L-BFGS-B", 
                lower = c(0, 0, 0), upper = c(1, 1, 1), control = optim.control)
              if (sol$convergence || any(sol$par &lt; 0 | sol$par &gt; 
                1)) {
                if (sol$convergence &gt; 50) {
                  warning(gettextf("optimization difficulties: %s", 
                    sol$message), domain = NA)
                }
                else stop("optimization failure")
              }
              alpha &lt;- sol$par[1L]
              beta &lt;- sol$par[2L]
              gamma &lt;- sol$par[3L]
          }
          else {
              error &lt;- function(p) hw(p[1L], beta, p[2L])$SSE
              sol &lt;- optim(c(optim.start["alpha"], optim.start["gamma"]), 
                error, method = "L-BFGS-B", lower = c(0, 0), 
                upper = c(1, 1), control = optim.control)
              if (sol$convergence || any(sol$par &lt; 0 | sol$par &gt; 
                1)) {
                if (sol$convergence &gt; 50) {
                  warning(gettextf("optimization difficulties: %s", 
                    sol$message), domain = NA)
                }
                else stop("optimization failure")
              }
              alpha &lt;- sol$par[1L]
              gamma &lt;- sol$par[2L]
          }
      }
      else {
          if (is.null(beta)) {
              error &lt;- function(p) hw(alpha, p[1L], p[2L])$SSE
              sol &lt;- optim(c(optim.start["beta"], optim.start["gamma"]), 
                error, method = "L-BFGS-B", lower = c(0, 0), 
                upper = c(1, 1), control = optim.control)
              if (sol$convergence || any(sol$par &lt; 0 | sol$par &gt; 
                1)) {
                if (sol$convergence &gt; 50) {
                  warning(gettextf("optimization difficulties: %s", 
                    sol$message), domain = NA)
                }
                else stop("optimization failure")
              }
              beta &lt;- sol$par[1L]
              gamma &lt;- sol$par[2L]
          }
          else {
              error &lt;- function(p) hw(alpha, beta, p)$SSE
              gamma &lt;- optimize(error, lower = 0, upper = 1)$minimum
          }
      }
  }
  else {
      if (is.null(alpha)) {
          if (is.null(beta)) {
              error &lt;- function(p) hw(p[1L], p[2L], gamma)$SSE
              sol &lt;- optim(c(optim.start["alpha"], optim.start["beta"]), 
                error, method = "L-BFGS-B", lower = c(0, 0), 
                upper = c(1, 1), control = optim.control)
              if (sol$convergence || any(sol$par &lt; 0 | sol$par &gt; 
                1)) {
                if (sol$convergence &gt; 50) {
                  warning(gettextf("optimization difficulties: %s", 
                    sol$message), domain = NA)
                }
                else stop("optimization failure")
              }
              alpha &lt;- sol$par[1L]
              beta &lt;- sol$par[2L]
          }
          else {
              error &lt;- function(p) hw(p, beta, gamma)$SSE
              alpha &lt;- optimize(error, lower = 0, upper = 1)$minimum
          }
      }
      else {
          if (is.null(beta)) {
              error &lt;- function(p) hw(alpha, p, gamma)$SSE
              beta &lt;- optimize(error, lower = 0, upper = 1)$minimum
          }
      }
  }
  final.fit &lt;- hw(alpha, beta, gamma)
  fitted &lt;- ts(cbind(xhat = final.fit$level[-len - 1], level = final.fit$level[-len - 
      1], trend = if (!is.logical(beta) || beta) 
      final.fit$trend[-len - 1], season = if (!is.logical(gamma) || 
      gamma) 
      final.fit$seasonal[1L:len]), start = start(lag(x, k = 1 - 
      start.time)), frequency = frequency(x))
  if (!is.logical(beta) || beta) 
      fitted[, 1] &lt;- fitted[, 1] + fitted[, "trend"]
  if (!is.logical(gamma) || gamma) 
      fitted[, 1] &lt;- if (seasonal == "multiplicative") 
          fitted[, 1] * fitted[, "season"]
      else fitted[, 1] + fitted[, "season"]
  structure(list(fitted = fitted, x = x, alpha = alpha, beta = beta, 
      gamma = gamma, coefficients = c(a = final.fit$level[len + 
          1], b = if (!is.logical(beta) || beta) final.fit$trend[len + 
          1], s = if (!is.logical(gamma) || gamma) final.fit$seasonal[len + 
          1L:f]), seasonal = seasonal, SSE = final.fit$SSE, 
      call = match.call()), class = "HoltWinters")
  </code></pre>
  
  <p>}</p>