-1

I want to make a simple barchart using data from Döring & Poeschl 2019 paper about how sexual relationships between humans and robots are represented in fictions, but I can't figure it out - I think I am missing something really obvious - or perhaps I organised the data badly or I just don't know about an option? The raw data isn't available so I'm using percentages from Table 3 in the paper. I want to show the relative distribution of male/female and heterosexual/homosexual/other for humans and for robots so I can compare with my own data about how humans and robots are represented in fictional media.

Döring, N., Poeschl, S. Love and Sex with Robots: A Content Analysis of Media Representations. Int J of Soc Robotics 11, 665–677 (2019). https://doi.org/10.1007/s12369-019-00517-y

I'm struggling to figure out the best way to actually show this information, simple as it seems. The raw data isn't available but I took the percentages for fictional humans and robots' gender and sexuality from Table 3 in Döring and Poeschl's paper - here it is as a dataframe in R:

sexbots <- structure(list(
        Variables = c("Female", "Male", "Child", "Adult", "Elderly", 
                      "Heterosexual", "Homosexual", "Other"), 
        Human = c(43, 62, 27, 57, 2, 78, 21, 1), 
        Robot = c(46, 55, 23, 55, NA, 78, 21, 1)), 
        row.names = c(NA, -8L), 
        class = c("tbl_df", "tbl", "data.frame"))

> sexbots
# A tibble: 8 × 3
  Variables    Human Robot
  <chr>        <dbl> <dbl>
1 Female          43    46
2 Male            62    55
3 Child           27    23
4 Adult           57    55
5 Elderly          2    NA
6 Heterosexual    78    78
7 Homosexual      21    21
8 Other            1     1

Note that the values are percentages not absolute numbers.

I can make a basic bar chart like this - I used geom_col()instead of geom_bar so it'd use the existing values rather than counting instances.

sexbots %>% 
        filter(Variables == "Female" | Variables == "Male") %>%
        ggplot() +
        geom_col(aes(x = Variables, y = Human, fill = "Variables" )) 

But how would I colour the columns so they are different for male or female? And how could I include the data on sexuality in the same chart without it looking silly?

Probably my real question is what is the best way to visualise this data? Perhaps even the way I made the dataframe is less than optimal? Is there a different way I could have dealt with the data about gender, sexuality and age in fictional media from Table 3 of Döring & Poeschl 2019?

  • Consider scanning a hand drawing of how you may want it to look. Then people can help you realize that graphic in R. – stomper Jan 29 '22 at 17:17
  • Given that it's more on the subjective side, this question might be a better fit for https://community.rstudio.com/. My first suggestion would be to add a column to categorize the different "kinds" of variables, depending on whether they relate to gender, sexuality, or age. That could give you more options for comparisons. I'd also swap out `fill = "Variables"` for `fill = Variables`, so it relies on the variable called `Variables` instead of a single text string called `"Variables"` which isn't connected to your data. – Jon Spring Jan 29 '22 at 17:19
  • Oh no, thanks for pointing out the misplaced quotation marks around Variables... Sigh... Thanks too for the tip about community.rstudio.com, that looks like a useful place :) – Jill Walker Rettberg Jan 29 '22 at 22:49

1 Answers1

0

Here are two ideas you could expand upon. The first gives you stacked bar charts. The second is based on the first but introduces polar coordinates and faceting.

sexbots %>%
    pivot_longer(cols = -Variables, values_to = "Count", names_to = "Type") %>%
    ggplot() +
    geom_col(aes(x = reorder(Variables, -Count), y = Count, fill = Type))


sexbots %>%
    pivot_longer(cols = -Variables, values_to = "Count", names_to = "Type") %>%
    ggplot() +
    geom_col(aes(x = Variables, y = Count, fill = Type)) +
    facet_wrap(~Variables) +
    coord_polar()

enter image description here

stomper
  • 1,252
  • 1
  • 7
  • 12