Closed crhammon closed 3 years ago
Charlie, Sorry for the inconvenience! This is a really confusing example, since everything looks in order. My off-the-cuff guess is that dataframename
was written over a few times and lost between sessions, especially if it works on one machine and not the other. What comes up if you run some basic investigation on the dataframe (head(dataframename)
, etc.).
I wish I could copy and paste for you!
head(dataframename)
shows similar things for both ineq
and dataframename
: nothing remarkable.
I even did dataframename[is.na(dataframename)] = 0
just to be cautious, as this would fill any null values that I had somehow missed. But I get the exact same error! This is quite vexing.
I somehow got it to work though. I think the key issue is I was trying to use a previously defined string as my dependent variable, while the function was looking for that defined variable name as a column in the data! It gets confusing sometimes when you put column names into a function without quotes, that makes it so I can't define var1 = 'string1'
and use var1
in a formula in a function.
Thanks for the response, all good now! I chalk this up to my having more experience with Python, where this sort of thing doesn't happen.
Error (forgive any typos, I have no internet connection where I have R installed):
I successfully used the
ineq
dataset, but am failing with my own data despite the fact thatstr(ineq)
tells me my dataframe is identical in structure toineq
and I have 100% complete cases and no missing values or NAs.My model that returns the error:
Model that works
again,
str(ineq)
tells me my data is identical toineq
and I checked for missing values and I manually inspected the data and every value is real and valid.I tried to reproduce the error on my other laptop, with everything being the same, and I could not get the same error.
Any clue about what might be happening?
Much obliged,
Charlie