I am running an lm regression in r, where there are categorical variables and numerical variables. I am usig knitr to compile the Rnw file to make a pdf. I use texreg to make latex regression tables. But when I do the compiling, it reported that lots of lines "Label `' multiply defined". Is it a must that we should assign label to each variable in the regression? But for those factor variables, I tried to assign label, like label(data$var) <- "name", then the warning is "label" command cannot be applied to the class of factor. Now I am really confused. Can anyone help me with this?
How to fix the warning "label `' multiply defined"
14k views Asked by Zhiling Wang At
3
There are 3 answers
0
On
A perl-bash snippet has been developed here:
perl -nE "say $1 if /(\\label[^}]*})/" *.tex | sort | uniq -c
which searches the .tex file for all \label{...}
s using the regular expression \\label[^}]*}
and then sot-group them by the number of occurance. Just fix the labels with more than 1 occurance (duplicated ones) and the warning should go away.
You are using the
texreg
package to create multiple tables for inclusion in a LaTeX document. When you use thetexreg
function, a LaTeX table is created. But all tables have the same line:LaTeX complains that this same label was included multiple times, thus not allowing you to reference any specific table.
To remedy the situation, you can include the
label
argument in your texreg calls as in the following example:Make sure you change the label for each table.