Emily Russell
Emily Russell

Reputation: 1

Barplot in R Returning "Error in barplot.default(SurveyInfo, main = "State Anxiety Pre-Experiment",: 'height' must be a vector or a matrix"

This is the line of code returning an error:

barplot(SurveyInfo, main="State Anxiety Pre-Experiment", xlab="ID", ylab="Anxiety Level", beside=TRUE, col=rainbow(7))

Note: I tried adding range of 1 into the code and it didn't fix the problem.

This is the previous code in the same script where I created the variable itself:

SubjInfo <- merge(SubjInfo,SubjInfoPre,by="ID") 
SurveyInfo <- SubjInfo %>% 
select(STAIY1_pre, STAIY1_post, STAIY2, BIS11, BDIII, RGPTSA, RGPTSB) 

This is what the data looks like

Upvotes: 0

Views: 73

Answers (0)

Related Questions