: $ operator is invalid for atomic vectors

injury_Data$body_f <- relevel(factor(injury_Data$body_part), ref = "Head")
Error in injury_Data$body_part : $ operator is invalid for atomic vectors

#head as reference
table(injury_Data$body_part)
Error in injury_Data$body_part : $ operator is invalid for atomic vectors

Its weird because it worked earlier but now its coming out as this.

If there are no attributes shown with

str(injuryData$bodyPart)

that’s the problem

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.