Hi, I tried to create a histogram but when running the code I received the message:
hist("Year")
Error in hist.default("Year") : 'x' must be numeric
When I checked the structure of my data frame, "Year" is defined as num , but when I check with class("Year") is said it is a character vector (code copied below). Can anyone explain why this happens and how can I change that? Thanks
str(Social_Enterprises_Trial)
tibble [287 × 6] (S3: tbl_df/tbl/data.frame)
Name : chr [1:287] ...
County : num [1:287] 22 6 7 16 20 16 7 7 5 5 ...
Location : num [1:287] 1 1 1 2 1 2 1 1 1 2 ...
Year : num [1:287] 1990 2015 2022 2007 1987 ...
class("Year")
[1] "character"