s and the
numeric value to the numeric variable.
Keeping in mind that a vector can only be of one class will save you many
debugging hours later on.
Tim
-Original Message-
From: Sarah Goslee
Sent: Tuesday, September 20, 2022 9:02 AM
To: tibor.k...@rub.de
Cc: Ebert,Timothy Aaron ; r-help@r-p
> missing. If you get data that has a new factor level, you need to tell R to
> > expect a new factor level first.
> >
> > levels(f1) <- c(levels(f1),"New Level")
> > levels(f1) <- c(levels(f1),c("NL1","NL2"))
> >
> >
> > T
,"New Level")
> levels(f1) <- c(levels(f1),c("NL1","NL2"))
>
>
> Tim
> -Original Message-
> From: R-help On Behalf Of Tibor Kiss via R-help
> Sent: Monday, September 19, 2022 6:11 AM
> To: r-help@r-project.org
> Subject: [R] Question
Dear Eric,
thank you very much. I wouldn’t have come to the idea to look up the help page
for _c()_, which of course explains the coercion to the highest type.
Best
T.
> Am 19.09.2022 um 13:31 schrieb Eric Berger :
>
> You are misinterpreting what is going on.
> The rbind command includes c
actor level first.
levels(f1) <- c(levels(f1),"New Level")
levels(f1) <- c(levels(f1),c("NL1","NL2"))
Tim
-Original Message-
From: R-help
mailto:r-help-boun...@r-project.org>> On Behalf
Of Tibor Kiss via R-help
Sent: Monday, September 19, 20
c(levels(f1),"New Level")
levels(f1) <- c(levels(f1),c("NL1","NL2"))
Tim
-Original Message-
From: R-help On Behalf Of Tibor Kiss via R-help
Sent: Monday, September 19, 2022 6:11 AM
To: r-help@r-project.org
Subject: [R] Question concerning side effects of tre
You are misinterpreting what is going on.
The rbind command includes c(char, char, int) which produces a
character vector of length 3.
This is what you are rbind-ing which changes the type of the RT column.
If you do rbind(df, data.frame(P="in", ANSWER="V>N",
RT=round(runif(1,7000,16000),0)))
you
Dear List members,
I have tried now for several times to find out about a side effect of treating
invalid factor levels, but did not find an answer. Various answers on
stackexchange etc. produce the stuff that irritates me without even mentioning
it.
So I am asking the list (apologies if this
8 matches
Mail list logo