According to [this blog post](https://ecologyforacrowdedplanet.wordpress.com/2013/08/27/r-squared-in-mixed-models-the-easy-way/) from 2013, the [`MuMIn`](http://cran.r-project.org/web/packages/MuMIn/MuMIn.pdf) package in `R` can provide R$^2$ values for mixed models *ala* an approach developed by [Nakagawa & Schielzeth 2013](http://onlinelibrary.wiley.com/doi/10.1111/j.2041-210x.2012.00261.x/abstract)$^1$ (which was mentioned in a previous [answer](https://stats.stackexchange.com/a/7241/80624)).

    #load packages
    library(lme4)
    library(MuMIn)
     
    #Fit Model
    m <- lmer(mpg ~ gear + disp + (1|cyl), data = mtcars)
     
    #Determine R2:
    r.squaredGLMM(m) 

           R2m       R2c 
     0.5476160 0.7150239  

The output for function`r.squaredGLMM` provides:

 - **R2m**: marginal R squared value associated with fixed effects

 - **R2c** conditional R2 value associated with fixed effects plus the random effects. 


Note: a comment on the linked [blog post](https://ecologyforacrowdedplanet.wordpress.com/2013/08/27/r-squared-in-mixed-models-the-easy-way/) suggests that an alternative Nakagawa & Schielzeth inspired approach developed by [Jon Lefcheck](https://jonlefcheck.net/2013/03/13/r2-for-linear-mixed-effects-models/) (using the `sem.model.fits` function in his `piecewiseSEM` package) produced identical results.  [so you have options :p].

 - I did not test this latter function, but I did test the `r.squaredGLMM()` function in the `MuMIn` package and so can attest that it is still functional today (2018).

 - As for the validity of this approach, I leave reading  Nakagawa & Schielzeth (2013) up to you. 

______________________________________
<sup> 1: Nakagawa, S., and Schielzeth, H. 2013. A general and simple method for obtaining R2 from generalized linear mixed‐effects models. *Methods in Ecology and Evolution* 4(2): 133-142. </sup>