title: Using LASSO in R with categorical variables
body: <p>I've got a dataset with 1000 observations and 76 variables, about twenty of which are categorical. I want to use LASSO on this entire data set. I know that having factor variables doesn't really work in LASSO through either lars or glmnet, but the variables are too many and there are too many different, unordered values they can take on to reasonably recode them numerically. </p>
  
  <p>Can LASSO be used in this situation? How do I do this? Creating a matrix of the predictors yields this response: </p>
  
  <pre><code>hdy&lt;-as.numeric(housingData2[,75])
  hdx&lt;-as.matrix(housingData2[,-75])
  model.lasso &lt;- lars(hdx, hdy)
  Error in one %*% x : requires numeric/complex matrix/vector arguments
  </code></pre>
  
  <p>I realize that other methods may be easier or more appropriate, but the challenge is actually to do this using lars or glmnet, so if it's possible, I would appreciate any ideas or feedback. </p>
  
  <p>Thank you,</p>