Packages

library(ggplot2)
library(plotly)
## Warning: package 'plotly' was built under R version 4.0.5
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v tibble  3.0.3     v dplyr   1.0.1
## v tidyr   1.1.2     v stringr 1.4.0
## v readr   1.4.0     v forcats 0.5.0
## v purrr   0.3.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks plotly::filter(), stats::filter()
## x dplyr::lag()    masks stats::lag()
library(ggpubr)
## Warning: package 'ggpubr' was built under R version 4.0.5
library(gapminder)
## Warning: package 'gapminder' was built under R version 4.0.5

File

ethic <- read.csv("C:/Users/z5218946/OneDrive - UNSW/Research/Ethics/ethics.data.clean.csv", header=TRUE, comment.char="#")
colnames(ethic)[1]="Course"
str(ethic)
## 'data.frame':    345 obs. of  36 variables:
##  $ Course     : int  1131 1131 1131 1131 1131 1131 1111 1111 1111 1111 ...
##  $ A01        : logi  FALSE TRUE FALSE TRUE TRUE TRUE ...
##  $ A02        : logi  TRUE FALSE FALSE TRUE FALSE FALSE ...
##  $ A03        : logi  FALSE FALSE FALSE TRUE TRUE FALSE ...
##  $ A04        : logi  TRUE TRUE FALSE TRUE TRUE FALSE ...
##  $ A05        : logi  TRUE TRUE FALSE TRUE TRUE FALSE ...
##  $ A06        : logi  FALSE TRUE FALSE TRUE TRUE TRUE ...
##  $ A07        : logi  TRUE FALSE TRUE TRUE FALSE TRUE ...
##  $ A08        : logi  FALSE FALSE FALSE TRUE FALSE TRUE ...
##  $ A09        : logi  TRUE FALSE FALSE TRUE FALSE FALSE ...
##  $ A10        : logi  TRUE TRUE TRUE TRUE TRUE TRUE ...
##  $ A11        : logi  FALSE TRUE FALSE TRUE TRUE FALSE ...
##  $ A12        : logi  TRUE TRUE TRUE TRUE FALSE TRUE ...
##  $ A13        : logi  FALSE TRUE FALSE TRUE FALSE FALSE ...
##  $ A14        : logi  TRUE TRUE TRUE TRUE FALSE FALSE ...
##  $ A15        : logi  FALSE TRUE FALSE TRUE TRUE TRUE ...
##  $ A16        : logi  TRUE TRUE TRUE TRUE FALSE TRUE ...
##  $ A17        : logi  TRUE TRUE FALSE TRUE FALSE TRUE ...
##  $ education  : int  3 3 3 3 3 3 3 NA 3 3 ...
##  $ hobby      : int  2 2 2 1 2 1 2 NA 5 4 ...
##  $ subject    : int  0 0 0 0 0 0 0 NA 0 0 ...
##  $ sport      : int  4 2 6 6 1 1 1 NA 1 6 ...
##  $ interest   : int  1 1 1 1 6 6 3 NA 4 3 ...
##  $ time       : chr  "Thursday2" "Thursday1" "Thursday2" "Thursday1" ...
##  $ thought    : int  2 2 0 2 2 2 2 3 0 1 ...
##  $ role       : int  2 3 2 3 2 3 0 3 3 2 ...
##  $ email      : chr  NA "r.berlee@student.unsw.edu.au" NA NA ...
##  $ person.code: chr  "ISFP " "ISTJ" "ISFP " "ISFP" ...
##  $ person     : chr  "Adventurer" "Adventurer" "Adventurer" "Adventurer" ...
##  $ person.type: chr  "Explorer" "Explorer" "Explorer" "Explorer" ...
##  $ interesting: chr  "Ana1, I think going straight to the meeting have higher efficiency." "I'm picking Question 17. It was very interesting to see the fairly even split between the old and new tradition"| __truncated__ "Most people decided to choose option 1 (You went straight to your first meeting). As an introduction to the gam"| __truncated__ "Q15 was regarding imposing a one-child policy in order to protect the colony from future starvation because of "| __truncated__ ...
##  $ game       : chr  NA "It was a very fun and engaging tutorial, by far my favourite SCIF1131 tutorial this term." "Playing a game and exploring real data from people similar to me gave me insights in an unique and fun way. How"| __truncated__ "The use of the game was innovative and engaging, it also facilitated decent discussion when we looked at the re"| __truncated__ ...
##  $ reflection : chr  NA "Ethics should definitely play some role in science, but my perception hasn't really changed. I already thought "| __truncated__ "My previous thoughts on the role of ethics in science is that ethics are important but shouldn't hinder progres"| __truncated__ "The activity didn't so much change my perception of ethics as much as it confirmed my prior thoughts on ethics."| __truncated__ ...
##  $ tutorial   : int  4 5 4 5 NA NA 3 NA 4 4 ...
##  $ podcast    : int  3 3 4 NA NA NA 2 2 3 4 ...
##  $ comment    : chr  NA "Nothing else, great tutorial!" NA NA ...

Grpah - ggplot

ethic2 <- ethic %>%
  filter(!is.na(person.type)) %>%
  filter(!is.na(A01)) %>%
  filter(!is.na(A09)) %>%
  filter(!is.na(A10)) %>%
  filter(!is.na(A11)) 


ggplotly(ggplot(ethic2, aes(person.type)) + geom_bar() + facet_wrap(.~A01))
ggarrange(
  ggplot(ethic2, aes(person.type)) + geom_bar() + facet_wrap(.~A01),
  ggplot(ethic2, aes(person.type)) + geom_bar() + facet_wrap(.~A09),
  ggplot(ethic2, aes(person.type)) + geom_bar() + facet_wrap(.~A10),
  ggplot(ethic2, aes(person.type)) + geom_bar() + facet_wrap(.~A11),
  ncol=2, nrow=2
)