memisc icon indicating copy to clipboard operation
memisc copied to clipboard

Items only recognized as numerical even when measurement is "nominal"

Open bixiou opened this issue 9 months ago • 4 comments

I noticed a bug with R 4.3.1 (my colleague does not have the bug with R 4.2.1). The following code returns NA instead of TRUE:

temp <- as.item(c(1), labels = structure(c(0, 1), names = c("No", "Yes")))
temp == "Yes"

This is despite measurement(temp) being nominal, i.e. we would expect that by default, temp is considered as string and not numerical.

Note that both temp == 1 and temp %in% "Yes" correctly return TRUE.

Is there a way to change this behavior?

My version of memisc is 0.99.22 (or rather, a patched version of 0.99.22, as explained here).

bixiou avatar May 13 '24 14:05 bixiou