r - Can not change lay-out of dotplot() (lattice package) based on ranef(lmerMod) -


we're trying use dotplot create caterpillarplot based on random effect structure of lmermod object created lmer() in lme4 package.

the plot created fine, when trying change lay-out errors occur.

sample of code without lay-out instructions:

all_bv_c <- lmer(rq_evt_a ~ sd_lft_m_cat4 + sd_opl_m_cat3 + ov_gez_m_4 +   (1|vsvnr), data=bv2, reml=true)  random <- ranef(all_bv_c, condvar = true)  dotplot(randoms, scales = list(x = list(relation = 'free'))) 

this creates plot:

dotplot

we wish change title, axis labels , color palette. example, change title, usual syntax be

dotplot(randoms, scales = list(x = list(relation = 'free')), main="title") 

this throws error:

error in if (main) nx : argument not interpretable logical

we've been unable around error. everywhere looked, should work dotplot usage. can shed light?

p.s.: we're using dotplot() on ggplot() due irregularities in extracting random effect structure data frame suggested here: ggcaterpillar. function specified throws null due to:

pv   <- attr(x, "postvar") 

we've tried other routes extracting variance/covariance matrix adapt function, felt dotplot easier route after fumbling day.

you can not here without changing code. looking @ source code of s3 method dotplot ranef.mer class:

gets3method("dotplot","ranef.mer") 

you can not set titles suing arguments. if in function in line written explicitly:

 mtit <- if (main) nx 

where nx names(x)( ranef object).

so if somthing :

names(randoms) <- "title"  dotplot(randoms) 

the plot title change. hack. better here change code of function , customize like.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -