tsostarics / contrastable

Contrast Coding Utilities
https://tsostarics.github.io/contrastable/
Other
0 stars 0 forks source link

Error when changing contrasts on large ordered factor #35

Closed tsostarics closed 1 month ago

tsostarics commented 1 month ago

(1) throws an error, as it should, but (2) throws an error when it shouldn't because non-polynomial contrasts are being used

enlist_contrasts(data.frame(x = gl(100,1,ordered=TRUE)), x ~ contr.poly) # (1) 
enlist_contrasts(data.frame(x = gl(100,1,ordered=TRUE)), x ~ sum_code) # (2)

better error handling needs to be done with use_contrasts to handle this one, will be fixed soon.

tsostarics commented 1 month ago

Here's what the new error will look like:

image