Why would R return NA as a lm() coefficient? I am fitting an lm() model to a data set that includes indicators for the financial quarter (Q1, Q2, Q3, making Q4 a default). Using lm(Y~., data = data) I get a NA as the coefficient for Q3, and a warning that one variable was exclude because of singularities. 
Do I need to add a Q4 column?
 A: NA as a coefficient in a regression indicates that the variable in question is linearly related to the other variables. In your case, this means that $Q3 = a \times Q1 + b \times Q2 + c$ for some $a, b, c$. If this is the case, then there's no unique solution to the regression without dropping one of the variables. Adding $Q4$ is only going to make matters worse.
A: I found this behavior when attempting to fit observations vs time, where time was given as POSIXct. lm and lsfit() both determined that the x's were co-linear. The problem was solved by subtracting the mean of the time datum to do the fit.
This appears to be a deficiency in the underlying code -- there must be some single precision operations, or non-optimal order of operations. I have never seen it before, so it may be new.
A: I also got this behavior in R version 4.2.0 with an integer64 dataframe column.
It was being fetched by an SQL query via RPostgres, from a PostgreSQL column of type int8 (that's 8-byte/64-bit integer).
Luckily, the data didn't actually exceed the 2-billion 32-bit cap; so a simple downconversion helped:
df$some_field <- as.integer(df$some_field)

Before I did that, lm would produce both NaN's and NA's in the coefficients.
How to diagnose: use class(df$some_field) to see which type the fields have.
