jeff-hughes / reghelper

R package with regression helper functions
5 stars 5 forks source link

Name reading in build_model #14

Closed akmontoya closed 2 years ago

akmontoya commented 2 years ago

I think there is an issue with the build_model function reading in enough characters. When I submit:

build_model(ParanormalBeliefs, RomanticStatus1, c(Extraversion,Agreeableness,Conscientiousness,NegativeEmotionality,OpenMindedness), data = testdat, model = "lm")

I get

Error in str2lang(x) : :1:53: unexpected ')' 1: ParanormalBeliefs ~ RomanticStatus1 + OpenMindedness)

if I change the variables names to y, x1, x2, x3, x4, x5, x6, then I don't get the same error

jeff-hughes commented 2 years ago

Hi there, yes, you're right! I did some quick testing and was able to replicate the issue. R's deparse function to convert an expression (like a vector of variable names) into a string "helpfully" splits the string into chunks according to a maximum line width. The default is 60 characters, so I guess in all my tests/uses I just never hit that limit.

At any rate, it seems like it will be a simple fix -- just glue the strings back together before continuing. I'll try to push out a fix within the next few days. Thanks for flagging this!

jeff-hughes commented 2 years ago

Alright, v1.1.1 has been accepted to CRAN, which should fix the problem you were having. Sometimes the package binaries take a day or two to be produced, so keep an eye out on the package page for when it's available for your OS.