Re: [R] Error with text analysis data

2022-04-13 Thread Neha gupta
>> >> >> >> >> >> We agree on that. However, the error gives you no hint about which >> >> variables are causing the problem. If it did, then it could only tell >> >> about the first variable with the problem. I think you would g

Re: [R] Error with text analysis data

2022-04-13 Thread Ebert,Timothy Aaron
ufl.edu>> Cc: Neha gupta mailto:neha.bologn...@gmail.com>>; r-help mailing list mailto:r-help@r-project.org>> Subject: Re: [R] Error with text analysis data [External Email] Constant columns can be the model when you do some subsetting or are exploring a new dataset. My obj

Re: [R] Error with text analysis data

2022-04-13 Thread Bill Dunlap
; *Sent:* Wednesday, April 13, 2022 12:23 PM > *To:* Ebert,Timothy Aaron > *Cc:* Neha gupta ; r-help mailing list < > r-help@r-project.org> > *Subject:* Re: [R] Error with text analysis data > > > > *[External Email]* > > Constant columns can be the model when you

Re: [R] Error with text analysis data

2022-04-13 Thread Bill Dunlap
ike summarize(y) or mean(y) if that was the goal. > > Tim > > -Original Message- > From: R-help On Behalf Of Bill Dunlap > Sent: Wednesday, April 13, 2022 9:56 AM > To: Neha gupta > Cc: r-help mailing list > Subject: Re: [R] Error with text analysis data > &

Re: [R] Error with text analysis data

2022-04-13 Thread Bill Dunlap
This sounds like what I think is a bug in stats::model.matrix.default(): a numeric column with all identical entries is fine but a constant character or factor column is not. > d <- data.frame(y=1:5, sex=rep("Female",5)) > d$sexFactor <- factor(d$sex, levels=c("Male","Female")) > d$sexCode <-

Re: [R] Error with text analysis data

2022-04-12 Thread Jim Lemon
Hi Neha, The error message is about not having _factors_ with two or more levels. Apart from using stringsAsFactors=FALSE (meaning that you probably won't get any factors in "d"), your sample data doesn't look like CSV format. Perhaps the lines have been truncated. You may get something with