title: 'relevel' only works with (unordered) factors
body: <pre><code>library(pacman)
  pacman::p_load(metafor,readxl,metaviz,MetaAnalyser,rio)
  #library(readxl,metaviz,MetaAnalyser,rio)
  
  
  #Effektstärke
  Bor1 &lt;- data.frame(read_excel(&quot;Borenstein_1.xls&quot;))
  
  Bor1 &lt;- escalc(measure = &quot;SMD&quot;, m1i=mw.t, m2i = mw.c, sd1i = sd.t, sd2i = sd.c, n1i= n.t, n2i= n.c, data= Bor1)
  
  
  #Heterogenitätstests Fixed/Random-Effects / Test for heterogeneity
  fe.mod &lt;- rma(yi = yi, vi = vi, measure = &quot;SMD&quot;, method = &quot;FE&quot;, slab = Studie, data = Bor1)
  forest(fe.mod, showweights = TRUE)
  
  re.mod &lt;- rma(yi = yi, vi = vi, measure = &quot;SMD&quot;, method = &quot;DL&quot;, slab = Studie, data = Bor1)
  
  forest(re.mod, showweights = TRUE)
  confint(re.mod)
  predict(re.mod)
  
  #Integration mit kategorialer Variable / Integration categorical variable
  Bor2 &lt;- read.delim2(&quot;Borenstein_2.txt&quot;)
  fe.all &lt;- rma(yi=d, vi=var.d, measure=&quot;SMD&quot;, method=&quot;FE&quot;, slab=study, data=Bor2)
  fe.A &lt;- rma(yi=d, vi=var.d, measure=&quot;SMD&quot;, method=&quot;FE&quot;, slab=study,
              subset=group==&quot;a&quot;, data=Bor2)
  
  fe.B &lt;- rma(yi=d, vi=var.d, measure=&quot;SMD&quot;, method=&quot;FE&quot;, slab=study,
              subset=group==&quot;b&quot;, data=Bor2)
  
  #Im Modell mit Kovariable: / Model with categorical variable
  fe.mod &lt;- rma(yi=d, vi=var.d, mods= ~group, measure=&quot;SMD&quot;, method=&quot;FE&quot;,
                slab=study, data=Bor2)
  fe.mod
  
  #Gruppe ‘a’ als Referenzgruppe: / Group a as reference
  fe.mod &lt;- rma(yi=d, vi=var.d, mods= **~relevel(group, ref=&quot;b&quot;)**, measure=&quot;SMD&quot;, method=&quot;FE&quot;,
                slab=study, data=Bor2)
  re.mod &lt;- rma(yi=d, vi=var.d, mods= ~group, measure=&quot;SMD&quot;, method=&quot;DL&quot;,
                slab=study, data=Bor2)
  
  
  #Meta-Regression
  bcg &lt;- escalc(measure=&quot;RR&quot;, ai=tpos, bi=tneg, ci=cpos, di=cneg, digits=3, data=dat.bcg)
  bcg[, -c(1,9)]
  </code></pre>
  <hr />
  <p>So I am supposed to write a meta-analysis in R but have never used R before. I am a bit overwhelmed.
  The code above is working except for the relevel function under group a as reference, in which I want to change the reference group in a subgroup analysis. So I have studies from group a and group b and want to change the reference group.
  For the relevel function I get the following error:</p>
  <p><em>Error in relevel.default(group, ref = &quot;b&quot;) :
  'relevel' only for (unordered) factors</em></p>
  <p>Sorry if I posted more code than necessary. I wasn't sure. Thanks in advance.</p>