I have a frequence table for females and males.
t1 <- table(PainF$pain_duration)
t2 <- table(PainM$pain_duration)
Females
30 40 45 60 65 70 75 78 80 90 95 100 101 120 144 150 180 185 240
3 3 2 5 1 2 1 1 1 5 1 1 1 3 1 1 1 1 2
Males:
2 10 15 20 30 38 40 45 50 55 60 70 72 73 75 80 90 95 100
105 110 120 130
2 2 1 2 3 1 4 4 3 2 11 1 1 1 1 2 10 1 1 1 1 11 2
150 180 200 240 300 500
2 5 1 3 3 1
This is the table the above number is the duration in minutes for a task and the below is the frequence of people, How can i put this data in a scatter plot, is it possible? I want to compare the data for females and males (the frequence) and duration.
I tried to use ggplot.
ggplot() +
geom_point(data = t1, aes(x = x, y = "column2"), color = "blue", size = 3) +
geom_point(data = t2, aes(x = x, y = "column2"), color = "red", size = 3) +
labs(x = "X", y = "Y", title = "Female and Male task duration") +
theme_minimal()
But i keep getting the following error message.
Error in
fortify()
:
!data
must be a <data.frame>, or an object coercible byfortify()
, or a valid
<data.frame>-like object coercible byas.data.frame()
.
Caused by error in.prevalidate_data_frame_like_object()
:
!dim(data)
must return an of length 2.
Runrlang::last_trace()
to see where the error occurred.
So my question is can i make a scatterplot based on a frequence table, and if so how can i do that?
Tried using ggplot2