Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the true raw data available? #7

Open
DaveParr opened this issue Aug 21, 2018 · 0 comments
Open

Is the true raw data available? #7

DaveParr opened this issue Aug 21, 2018 · 0 comments

Comments

@DaveParr
Copy link

v <- list()
for(i in 1:length(
grep("csv", list.files(), value=T)
)
)
{
v[[i]] <- read.csv(grep("csv", list.files(), value=T)[i],
stringsAsFactors=F)[,
c("Date","NumberOfSubjects","Fatal","SubjectArmed",
"Notes","SubjectRace","SubjectGender","SubjectAge",
"NatureOfStop", "NumberOfShots","NumberOfOfficers",
"OfficerRace","OfficerGender","Department",
"FullNarrative")]
v[[i]]$Date <- as.character(v[[i]]$Date)
v[[i]]$Notes <- as.character(v[[i]]$Notes)
v[[i]]$city <- substr(unlist(lapply(strsplit(grep("csv",
list.files(), value=T), "_"), "[[", 1))[i], 9, 100)
}

This appears to reference iterating over a number of seperated files, and creating an object that at the end is referred to as dat.

r <- subset(dat, year>2009&year<2017)

write.csv(vic, "../SubjectBased_Final.csv")
write.csv(r, "../IncidentBased_Final.csv")

This appears to use that same object to perform more processing and cleaning finally writing the two data files in the repo.

The link in the article points to this page which links to this spreadsheet, which is also not the full data. It looks to just be the subject_data.csv, not the incident data, and not the raw files I'm assuming generated the both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant