Hello,

in various code I am using, i am getting this kind of error.

boxplot(ILCobas ~ AVCdensweibl + Diabetes_Mellitus, data = Frauen)

Error in terms.formula(formula, data = data) :

attempt to use zero-length variable name

I keep checking all variables, but they seem fine.

In this case, i converted a "Chr" variable like "Diabetes_Mellitus" into a factor by first labelling and then using the function as.factor().

When i open th variable, tere are the two factors listed as well as Levels:...

an example:

dataset : data

Variable numerical: VARnum

Variable dichometric (chr): A, B

Correlation of VARnum with A + B

A: 0,1

B: 0,1

first: Labelling

data$A[data$A=="0"] <- noA

data$A[data$A=="1"] <- A

data$A <- as.factor(data$A)

#again with Variable B

data$B[data$B=="0"] <- noA

data$B[data$B=="1"] <- A

data$B <- as.factor(data$B)

describedBy (VARnum ~ A + B, data=data)

*running well*

boxplot ( VARnum ~ A + B, data=data)

*Error in terms.formula(formula, data = data) : attempt to use zero-length variable name*