Error in boxcox.default(y ~ x) : response variable must be positive Error in boxcox.default(y ~ x) : response variable must be positive

I am getting this error in R when I am performing a Box-Cox transformation on data.
Why is this error happening? Here is my data.  
This is a time series data and I have to perform logarithmic regression of the form:
$$y=a+b(\log x_1)+c(\log x_2)$$
I need to find a, b, c and then, check if any such type of relation exists or not.
 A: Yes, the boxcox only works with positive values for the response variable $Y$. More details can be found in wikipedia. To workaround this limitation, you can try to predict a shifted version $Y+\mu$ (with $\mu \gt \min Y$) of your variable instead. 
A quick code example:
library(MASS)

## Invent example for x and y
y = c(rnorm(100,3,300), rnorm(30,1600,400))
x = 1:length(y)
## Histogram of y shows that y is skewed
hist(y)
## Define parameters for boxcox
eps = 1e-5
n = 100;
mu = seq(-min(y) + eps, max(y), length = n)
lambda = seq(0, 5, length = n)
## Initialize then calculate log likelihood values
lik = matrix(0, n, n)
for (i in 1:n) lik[, i] = boxcox((y + mu[i])~x, lambda = lambda, plotit = FALSE)$y
## Plot log likelihood values
image(lik, xlab = "mu", ylab = "lambda", main = "likelihood")

A: Zeros will also block the boxcox() function naturally since "response variable must be positive". 
However when you have a lot of zeros in your data with a specific meaning (the measured event did not occur at all) then it's a good idea to exclude them from the transformation instead of increasing the value by an arbitrary epsilon.
When you add 1 to the zeros then (1^lambda-1)/lambda becomes 0 after the transformation, but becomes 1 when you reverse transform it: (0*lambda+1)^(1/lambda).
When you add a small fraction to it - at large negative lambdas - the value transformed into arbitrary large negative range:
lambdas <- seq(-6,6,0.01)
lambdas <- lambdas[lambdas!=0]
plot(lambdas, (0.1 ^ lambdas  - 1)/lambdas, type="l")

All in all I felt safer to handle separately the zeros when they have specific meaning.
