title: Obtaining an error when running exact code from a blog
body: <p>I am following a tutorial <a href="https://datashenanigan.wordpress.com/2016/05/24/a-gentle-introduction-to-finance-using-r-efficient-frontier-and-capm-part-1/" rel="nofollow noreferrer">here</a>. A few days ago I was able to run this code without error and run it on my own data set (it was always a little hit and miss with obtaining this error) - however now I try to run the code and I always obtain the same error.</p>
  
  <blockquote>
    <p>Error in solve.QP(Dmat, dvec, Amat, bvec = b0, meq = 2) :<br>
    constraints are inconsistent, no solution!</p>
  </blockquote>
  
  <p>I get that the <code>solver</code> cannot solve the equations but I am a little confused as to why it worked previously and now it does not... The author of the article has this code working...</p>
  
  <pre><code>library(tseries)
  library(data.table)
  link &lt;- "https://raw.githubusercontent.com/DavZim/Efficient_Frontier/master/data/mult_assets.csv"
  
  df &lt;- data.table(read.csv(link))
  
  df_table &lt;- melt(df)[, .(er = mean(value),
                           sd = sd(value)), by = variable]
  
  er_vals &lt;- seq(from = min(df_table$er), to = max(df_table$er), length.out = 1000)
  
  # find an optimal portfolio for each possible possible expected return 
  # (note that the values are explicitly set between the minimum and maximum of the expected returns per asset)
  sd_vals &lt;- sapply(er_vals, function(er) {
    op &lt;- portfolio.optim(as.matrix(df), er)
    return(op$ps)
  })
  </code></pre>
  
  <p>SessionInfo:</p>
  
  <pre><code>R version 3.5.3 (2019-03-11)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  Running under: Windows &gt;= 8 x64 (build 9200)
  
  Matrix products: default
  
  locale:
  [1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252    LC_MONETARY=Spanish_Spain.1252
  [4] LC_NUMERIC=C                   LC_TIME=Spanish_Spain.1252    
  
  attached base packages:
  [1] parallel  stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] lpSolve_5.6.13.1  data.table_1.12.0 tseries_0.10-46   rugarch_1.4-0    
  
  loaded via a namespace (and not attached):
   [1] Rcpp_1.0.0                  MASS_7.3-51.1               mclust_5.4.2               
   [4] lattice_0.20-38             quadprog_1.5-5              Rsolnp_1.16                
   [7] TTR_0.23-4                  tools_3.5.3                 xts_0.11-2                 
  [10] SkewHyperbolic_0.4-0        GeneralizedHyperbolic_0.8-4 quantmod_0.4-13.1          
  [13] spd_2.0-1                   grid_3.5.3                  KernSmooth_2.23-15         
  [16] yaml_2.2.0                  numDeriv_2016.8-1           Matrix_1.2-15              
  [19] nloptr_1.2.1                DistributionUtils_0.6-0     ks_1.11.3                  
  [22] curl_3.3                    compiler_3.5.3              expm_0.999-3               
  [25] truncnorm_1.0-8             mvtnorm_1.0-8               zoo_1.8-4 
  </code></pre>