I want to get a linar model from almost 900 variables, but lm throws me an error that many colums have NAs, any advice?

See this post

Consider starting more simply.

fit  <- lm(mpg ~ drat, data = mtcars)

before moving on to trying to assess all variables

fit2 <- lm(mpg ~ ., data = mtcars

Among 900 variables, some will be irrelevant, some redundant and others antagonistic. There is no also no practicable way to explore all possible combinations. For 900 variables, a large number of observations will be required to avoid the curse of dimensionality and feature engineering/dimensionality reduction will probably be required. See Chapter 4 Regression Modeling Strategies With Applications to Linear Models, Logistic and Ordinal Regression, and Survival Analysis, Frank E. Harrell , Jr. (2015).