Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clmm + R 4.0 throws warning with long formula #34

Closed
stragu opened this issue Jul 23, 2020 · 5 comments
Closed

clmm + R 4.0 throws warning with long formula #34

stragu opened this issue Jul 23, 2020 · 5 comments

Comments

@stragu
Copy link

stragu commented Jul 23, 2020

Using R 4.0.2 and ordinal 2019.12-10, I get a warning when using a formula with long names (but not changing the underlying data or the formula structure).

See for example this reprex:

library(ordinal)
wine1 <- wine
# short version:
mm <- clmm(rating ~ temp + contact + (1|judge),
           data = wine1) # no warning
names(wine1)[2] <- "a_very_very_very_very_very_long_name"
# long version:
mm <- clmm(a_very_very_very_very_very_long_name ~ temp + contact + (1|judge),
           data = wine1) # warning
#> Warning: Using formula(x) is deprecated when x is a character vector of length > 1.
#>   Consider formula(paste(x, collapse = " ")) instead.
# it's the length of the whole formula that matters, not the length
# of a single variable's name:
wine2 <- wine
names(wine2) <- lapply(names(wine), paste0, "_quite_long")
mm <- clmm(rating_quite_long ~ temp_quite_long + contact_quite_long + (1|judge_quite_long),
           data = wine2) # warning too
#> Warning: Using formula(x) is deprecated when x is a character vector of length > 1.
#>   Consider formula(paste(x, collapse = " ")) instead.

Created on 2020-07-23 by the reprex package (v0.3.0)

I believe this might be because of how the clmm.formulae() function is defined, and might very well need a fix similar to issue #13 and PR #30, but I have a limited understanding of the functions involved, so I could be completely wrong! 🙂

@stragu stragu changed the title clmm + 4.0 throws warning whith long formula clmm + 4.0 throws warning with long formula Jul 23, 2020
@stragu stragu changed the title clmm + 4.0 throws warning with long formula clmm + R 4.0 throws warning with long formula Jul 24, 2020
@ghost
Copy link

ghost commented Aug 15, 2020

Just echoing stragu with regard to the warning in ordinal::clmm (and the same setup: R 4.0.2 and ordinal_2019.12-10)

This model

m <- clmm(JUDGMENT ~ 1 + NATIVE_LG * AGREEMENT + EMPHPRON + NEGATION + (1|SUBJECT), data=x)

runs fine but throws a warning message

Using formula(x) is deprecated when x is a character vector of length > 1.
  Consider formula(paste(x, collapse = " ")) instead.`

but if the last predictor is deleted, then it works without problems:

m <- clmm(JUDGMENT ~ 1 + NATIVE_LG * AGREEMENT + EMPHPRON + (1|SUBJECT), data=x)

@runehaubo
Copy link
Owner

runehaubo commented Aug 15, 2020 via email

@runehaubo
Copy link
Owner

Now fixed in the version on GitHub dated 2020-08-22.

Thanks again for mentioning this!

@florenceruby
Copy link

Hi Rune,
I am experiencing the same issue as above using ordinal_2019.12-10 on R 4.0.2.
Because I have to analyse data on a secure platform we can only access packages from CRAN. Is there a chance the updates you made on the package will be avialble on CRAN soon?

Thanks a lot

@stragu
Copy link
Author

stragu commented Jul 19, 2021

Hi @runehaubo
Just wanted to report that a colleague ran into the same warning with clm(), so I assume that function needs a similar fix as well?
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants