knitr::opts_chunk$set(echo = TRUE)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

plot(pressure)

Note that the echo = TRUE parameter was added to the code chunk to prevent printing of the R code that generated the plot. install.packages(‘dplyr’) install.packages(“kableExtra”) install.packages(“readr”) install.packages(“tidyverse”) install.packages(“tidyr”) install.packages(“ggplot2”) install.packages(“ggmap”) install.packages(“data.table”) install.packages(“vtable”) install.packages(“magrittr”) install.packages(“girafe”) library(dplyr) library(kableExtra) library(vtable) vtable(zip_info, lush = TRUE) library(magrittr) library(readr) library(tidyverse) library(tidyr) library(ggplot2) library(ggmap) library(data.table) library(girafe)

this data shows that those that are less represented feel less safe.

relevant_data <- data[, c(“Do you feel safe at SU? Rate on a scale of 1-5 (1 being you DON’T feel safe, 5 being you feel safe)”, “What has your experience at Albers/SU been like?”)]

Rename the columns for easier reference

colnames(relevant_data) <- c(“Safety_Rating”, “Experience”)

Convert the “Experience” column to lowercase

relevant_data\(Experience <- tolower(relevant_data\)Experience)

Calculate correlation

correlation <- cor.test(relevant_data\(Safety_Rating, as.numeric(factor(relevant_data\)Experience)))

Calculate the average safety rating for each race group

average_safety <- aggregate(data\(`Do you feel safe at SU? Rate on a scale of 1-5 (1 being you DON'T feel safe, 5 being you feel safe)`, by = list(Race = data\)Race), FUN = mean)

Load the dataset from Excel

data <- read_excel(“Open Discussion for BLCC (Responses).xlsx”)

Create an interactive scatter plot

plot <- plot_ly(data = data, x = data\(`Do you feel safe at SU? Rate on a scale of 1-5 (1 being you DON'T feel safe, 5 being you feel safe)`, y = data\)Race, text = data$What has your experience at Albers/SU been like?, type = ‘scatter’, mode = ‘markers’, marker = list(size = 10))

Customize layout

plot <- plot %>% layout(title = “Relationship between Feeling of Safety, Race, and Experience at Albers/SU”, xaxis = list(title = “Feeling of Safety at SU”), yaxis = list(title = “Race”))

Show plot

plot

#rows 20-34

Load necessary libraries

library(plotly) library(readxl)

Load the dataset from Excel

data <- read_excel(“Open Discussion for BLCC (Responses).xlsx”)

Specify the range of rows to display (e.g., rows 20 to 34)

selected_data <- data[20:34,]

Create an interactive scatter plot

plot <- plot_ly(data = selected_data, x = ~Do you feel safe at SU? Rate on a scale of 1-5 (1 being you DON'T feel safe, 5 being you feel safe), y = ~Race, text = ~What has your experience at Albers/SU been like?, type = ‘scatter’, mode = ‘markers’, marker = list(size = 10))

Customize layout

plot <- plot %>% layout(title = “Relationship between Feeling of Safety, Race, and Experience at Albers/SU”, xaxis = list(title = “Feeling of Safety at SU”), yaxis = list(title = “Race”))

Show plot with the selected data points

plot