Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This function was written to create a general data frame for the output
- # of this function: http://pastebin.com/eTJHsS6A
- getdataframe <- function (data) {
- data <- readLines("homicides.txt")
- causes <- c("asphyxiation", "blunt force", "shooting",
- "stabbing", "other", "unknown")
- df <- data.frame(Cause = character(),
- Gender = character(),
- stringsAsFactors=FALSE)
- for (i in causes) {
- cause <- i
- result <- gendercause(data, cause)
- df <- rbind(result, df)
- }
- return(df)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement