犯罪是一個國際關注的問題,但它在不同的國家以不同的方式記錄和處理。 在美國,聯邦調查局(FBI)記錄了暴力犯罪和財產犯罪。 此外,每個城市都記錄了犯罪行為,一些城市發布了有關犯罪率的數據。 伊利諾伊州芝加哥市從2001年開始在線發布犯罪數據。

芝加哥是美國人口第三多的城市,人口超過270萬。在這個作業裡面,我們將關注一種特定類型的財產犯罪,稱為「汽車盜竊」,我們將使用R中的一些基本數據分析來了解芝加哥的汽車盜竊紀錄。請載入文件“data/mvtWeek1.csv”:以下是各欄位的描述:



Section-1 Loading the Data

【1.1】How many rows of data (observations) are in this dataset?

#

檢查各欄位的資料格式

#

類別(Factor) versus 字串(Character)

【1.2】How many variables are in this dataset?

#

【1.3】Using the “max” function, what is the maximum value of the variable “ID”?

#

【1.4】 What is the minimum value of the variable “Beat”?

#

【1.5】 How many observations have value TRUE in the Arrest variable (this is the number of crimes for which an arrest was made)?

#

【1.6】 How many observations have a LocationDescription value of ALLEY?

#




Section-2 Understanding Dates in R

【2.1】 In what format are the entries in the variable Date?

#
#
#
#

【2.2】 What is the month and year of the median date in our dataset?

#

【2.3】 In which month did the fewest motor vehicle thefts occur?

#

【2.4】 On which weekday did the most motor vehicle thefts occur?

#

【2.5】 Which month has the largest number of motor vehicle thefts for which an arrest was made?

#