R hurdle: In sqrt(diag(object$vcov)) : NaNs produced
<p>I have a dataframe from csv, that consist 1 dependent variable (y) and 7 independent variables (x's). Y consist of many zeros. So I want to use hurdle (truncated poisson for count and logit for zero)
This is my code</p>

<pre><code>library(pscl)
data &lt;-  read.csv("D:/data.csv", header=TRUE, sep=",")
head(data)
x1 &lt;- data$X1
x2 &lt;- data$X2
x3 &lt;- data$X3
x4 &lt;- data$X4
x5 &lt;- data$X5
x6 &lt;- data$X6
x7 &lt;- data$X7
y &lt;- data$Y

data &lt;- data.frame(x1,x2,x3,x4,x5,x6,x7,y)
head(data)
hurdlepois &lt;-hurdle(y~x1+x2+x3+x4+x5+x6+x7, data=data)
summary(hurdlepois)
</code></pre>

<p>The results is there are coefficients, but there are NaNs in std.error. And I get Warning</p>

<pre><code>Warning message:
In sqrt(diag(object$vcov)) : NaNs produced
</code></pre>

<p>Someone suggest me to do this code</p>

<pre><code>ctrl &lt;- hurdle.control(method = "L-BFGS-B")
ctrl$reltol &lt;- NULL
hurdlepois &lt;-hurdle(y~x1+x2+x3+x4+x5+x6+x7, data=data, control = ctrl)
summary(hurdlepois)
</code></pre>

<p>But I get this error when I run hurdlepois &lt;-hurdle(y~x1+x2+x3+x4+x5+x6+x7, data=data, control = ctrl)</p>

<pre><code>Error in optim(fn = countDist, gr = countGrad, par = c(start$count, if (dist ==  : 
  L-BFGS-B needs finite values of 'fn'
</code></pre>

<p>Can you help me please? Please give me detail solution what should I do, because I'm beginner and so desperate. Thank you so much.</p>