-
Notifications
You must be signed in to change notification settings - Fork 81
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
Variable Labels from Hmisc and lm function R3.5.0 #93
Comments
Can you provide an example? The following works for me.
|
Well, at first I ran your example and it gave me the same error. I figured
something must be fishy, so I re-installed Hmisc and re-ran your example.
It worked, so I re-ran my example. It also worked. So, there must have been
something that didn't update properly when I updated R and my packages. At
any rate, fixed now? We'll hope?
Thanks for your time attention.
Jim
On Wed, May 30, 2018 at 5:48 PM Cole Beck ***@***.***> wrote:
Can you provide an example? The following works for me.
library(Hmisc)
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
label(group) <- "Treatment Group"
weight <- c(ctl, trt)
summary(lm(weight ~ group))
class(group) returns [1] "labelled" "factor"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#93 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQOL2a6-j2SdnUj431-VG_PnMKLAp82zks5t3yHCgaJpZM4UUEBM>
.
--
James T. Bang, Ph.D.
Associate Professor and Chair
Department of Economics
St. Ambrose University
540-460-5948 (c)
"I was into data before it was big."
|
Reinstalling and restarting R is always a great place to start. My first thought was that you might have an additional package loaded interfering with behaviour. For instance, the haven package creates a |
Here's an example with an Hmisc dataset that was labelled showing the maven problem.
|
When I updated to R 3.5.0, several lm and glm command lines started giving an error, "Error:
x
must be a numeric or a character vector." Running the same lines in R 3.4.4 did not give that command. I was able to determine that these commands ran fine in R 3.5.0 if I ran them before assigning variable labels using the label() command, but not after assigning the labels. My short run solution is "don't use the labels." But descriptive English labels are nice to have when you have a lot of variables.The text was updated successfully, but these errors were encountered: