Why is beginning of this FIR filtered signal attenuated? I apply an FIR filter passing the band around 50/1000 and attenuating the other three frequency components 30/1000, 70/1000 and 110/1000.

Both filters are generated using the Remez algorithm. The first filter is of length 300 and the second is of length 100.

Why is the beginning of the filtered signal attenuated and why is this attenuation effect stronger for a longer filter?

library(signal)
par(mfrow=c(3,2))

ch &lt;- 
  sin(2*pi*1:1000/floor(1000/30)) +
  sin(2*pi*1:1000/floor(1000/50)) +
  sin(2*pi*1:1000/floor(1000/70)) +
  sin(2*pi*1:1000/floor(1000/110))

# FFT of signal
barplot(abs(fft(ch)[1:120]))

# unfiltered signal
plot(ch,type="l")

filter &lt;- function(c0,d1,d2,n) {
  fir &lt;- remez(n=n,f=c(0,c0-d2,c0-d1,c0+d1,c0+d2,1),a=c(0,0,1,1,0,0))

  freq &lt;- freqz(fir,n=n)
  y &lt;- signal::filter(as.vector(fir), 1, x=ch)

  # frequency response of filter
  barplot(abs(fft(y))[1:120])
  return(list(freq = freq, fir = fir, y = y))
}

f &lt;- filter(2*50/1000,1/80,1/40,n=300)

# first filtered signal
plot(f$y, type="l")


f &lt;- filter(2*50/1000,1/80,1/40,n=100)

# second filtered signal
plot(f$y, type="l")
The filter you designed is a linear phase filter, therefore, response of the filter will start at $N/2$th sample, where $N $ is the filter order. As $N$ increases so does the delay of the response. You can find this delay value by computing group delay of the filter. 

In case you want to reduce the delay, you can design a minimum phase filter.