title: What is Error in value[[3L]](cond) in R?
body: <p>I have a code that has an error because of not enough memory. Actually I do a linear model (lm) on a big data. The problem is not because it gives me the error, that I want to log, but because it contains <code>value[[3L]](cond)</code>.</p>
  
  <p>My error looks like this:</p>
  
  <pre><code>Error in value[[3L]](cond): While training model Error: cannot allocate vector of size 6.4 Gb
  </code></pre>
  
  <p>The code that logs it look like this (using logging lib):</p>
  
  <pre><code>tryCatch({
    # some code
    tryCatch({
      # some other code
    }, warning = function(war){
      logwarn(war, logger = "MyLogger")
    }, error = function(err){
      stop(paste("While training model", err, sep = " "))
    })
    some more code
  }, error = function(err){
    logerror(err, logger = "MyLogger")
  })
  </code></pre>
  
  <p>My problem is why is it saying <code>Error in value[[3L]](cond):</code>? Is it something wrong that I did and I do not know? Shouldn't it be just <code>Error: &lt;error message&gt;</code>?</p>