##This plot shows a car's speed vs its distance.## plot(cars$speed, cars$dist)
2024-06-07
##This plot shows a car's speed vs its distance.## plot(cars$speed, cars$dist)
library(readxl)
DAT <- read_xlsx("C:/Users/conno/Downloads/41.18_Arrests_2021_-_Feb_2024.xlsx")
colnames(DAT)
## [1] "Report ID" "Report Type" ## [3] "Year" "Arrest Date" ## [5] "Time" "Time Range" ## [7] "Area Name" "Reporting District" ## [9] "Age" "Sex" ## [11] "Race" "Charge Group Description" ## [13] "Arrest Type" "Charge" ## [15] "Charge Description" "Disposition Description" ## [17] "Address" "Cross Street" ## [19] "LAT" "LON" ## [21] "CD"
library(ggplot2) ##The main problem I noticed from this data set is how many charges and crimes there were at first, so it was difficult to organize each problem that occurred in Los Angeles. It was also difficult because it was over a 4 year span with the entirety of Los Angeles. ## https://4118recentarrests.lacontroller.app/ << This is the map that I used for reference for my data. ## https://docs.google.com/spreadsheets/d/1BMnzp75G0mWpEDKGgL-jLrZzKA2q8xFRfv0UqTLU0uk/edit#gid=1419668738 The excel page used to collect the data from the data set. #This graph shows what the graphs description is by age and time. ## Based on the graphs I have come to the conclusion that the crimes in Los Angeles were consistent throughout the years and didn't have a certain pattern. ggplot(DAT, aes(x = "Arrest Date", y = "Charge")) +geom_point() +geom_jitter() +geom_smooth(method = 'lm')
## Warning in geom_point(): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## Warning in geom_jitter(): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## Warning in geom_smooth(method = "lm"): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## `geom_smooth()` using formula = 'y ~ x'
ggplot(DAT, aes(x = "Report Type", y = "Year")) +geom_point() +geom_jitter() +geom_smooth(method = 'lm')
## Warning in geom_point(): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## Warning in geom_jitter(): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## Warning in geom_smooth(method = "lm"): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## `geom_smooth()` using formula = 'y ~ x'
ggplot(DAT, aes(x = "Age", y = "Charge")) +geom_point() +geom_jitter() +geom_smooth(method = 'lm')
## Warning in geom_point(): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## Warning in geom_jitter(): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## Warning in geom_smooth(method = "lm"): All aesthetics have length 1, but the data has 3544 rows. ## ℹ Please consider using `annotate()` or provide this layer with data containing ## a single row.
## `geom_smooth()` using formula = 'y ~ x'