title: Warning message: 'newdata' had 20 rows but variables found have 1000 rows
body: <pre><code>#This is my model
  
  linearMod &lt;- lm( Housing_Training$SalePrice ~ Housing_Training$MSSubClass + Housing_Training$LotFrontage + Housing_Training$LotArea + Housing_Training$OverallQual + 
                     Housing_Training$OverallCond + Housing_Training$YearBuilt + Housing_Training$YearRemodAdd + Housing_Training$MasVnrArea + Housing_Training$TotalBsmtSF +
                     Housing_Training$GrLivArea + Housing_Training$FullBath + Housing_Training$HalfBath + Housing_Training$BedroomAbvGr +Housing_Training$KitchenAbvGr + Housing_Training$TotRmsAbvGrd + 
                     Housing_Training$Fireplaces + Housing_Training$GarageYrBlt + Housing_Training$GarageCars + Housing_Training$GarageArea + Housing_Training$WoodDeckSF + Housing_Training$OpenPorchSF +
                     Housing_Training$MoSold + Housing_Training$YrSold, data=Housing_Training)
  
  
  
  
  #this is my test data that i want to use in the model:
  
  Housing_Testing_20x &lt;- Housing_Testing[complete.cases(Housing_Testing), ]
  Housing_Testing_20&lt;-data.frame(Housing_Testing_20x[1:20,])
  
  predict(linearMod,newdata = Housing_Testing_20)
  
  </code></pre>
  <p>Basically, my Housing_Testing LM model contains 1000 rows (comparing sale price column to all other columns (size, rooms, etc.)</p>
  <p>Then I have a Housing_testing dataset, I need to take out all of rows that have NA, and then take the first 20 rows and use the model to predict a housing price.</p>
  <p>However, when I try to run the linearmodel with the Housing _testing_20 dataset it's giving me an error (after showing me 1000 rows); my response should be 20 rows of Housing Sale price predictions</p>