tag:blogger.com,1999:blog-3524617892004055830.post5309386843792339563..comments2024-02-29T10:02:38.091+01:00Comments on Wiekvoet: Guns are coolWingfeethttp://www.blogger.com/profile/01585623097384646816noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-3524617892004055830.post-57072339651459344202013-09-22T10:27:25.799+02:002013-09-22T10:27:25.799+02:00Hi Burhan,
The first I recognize; the data for nu...Hi Burhan,<br /><br />The first I recognize; the data for number 249 is not complete. It just says ''Number 249: 9/14/13, Earl Spencer Boyce'. Did you run the statement:<br />r1[r1=='Number 249: 9/14/13, Earl Spencer Boyce'] <-<br /> 'Number 249: 9/14/13, Earl Spencer Boyce, 4 injured, Marion, NC' just after reading the r1 data?<br /><br />The second suggests some missing data in Date. The way I read the data creates an empty first and last line. The statement r2 <- gsub('Number ','',r1[r1!='']) removes the empty lines next to removing the word number. But it may also be something else. <br /><br />Wingfeethttps://www.blogger.com/profile/01585623097384646816noreply@blogger.comtag:blogger.com,1999:blog-3524617892004055830.post-36812909127538615872013-09-22T10:00:17.258+02:002013-09-22T10:00:17.258+02:00Hi,
I encounter two errors, when trying the abov...Hi, <br /><br />I encounter two errors, when trying the above: <br /><br />1.> mydf$location <- sapply(r5,function(x) {<br />+ end <- length(x)-1<br />+ begin <- max(grep('injured|dead',x))+1<br />+ if (begin==-Inf) print(x) <br />+ substring(paste(x[begin:end]),2)[1]<br />+ })<br /><br />for me, returns: <br /><br />[1] "Earl Spencer Boyce"<br />Error in begin:end : result would be too long a vector<br />In addition: Warning message:<br />In max(grep("injured|dead", x)) :<br /> no non-missing arguments to max; returning -Inf<br /><br /><br />2. mydf$fDate <- factor(<br /> levels=as.character(seq(min(mydf$Date),max(mydf$Date),by=1)),<br /> as.character(mydf$Date))<br /><br />For me - returns:<br /><br />Error in seq.int(0, to0 - from, by) : 'to' must be finite<br /><br /><br />Am I doing something wrong, here - please comment:<br /><br />Here is the sessionInfo<br /><br />> sessionInfo()<br />R version 3.0.1 (2013-05-16)<br />Platform: x86_64-w64-mingw32/x64 (64-bit)<br /><br />locale:<br />[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 <br />[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C <br />[5] LC_TIME=English_United States.1252 <br /><br />attached base packages:<br />[1] stats graphics grDevices utils datasets methods base <br /><br />other attached packages:<br />[1] plyr_1.8 ggplot2_0.9.3.1 shiny_0.7.0 <br /><br />loaded via a namespace (and not attached):<br /> [1] bitops_1.0-6 caTools_1.14 colorspace_1.2-3 dichromat_2.0-0 <br /> [5] digest_0.6.3 grid_3.0.1 gtable_0.1.2 httpuv_1.1.0 <br /> [9] labeling_0.2 MASS_7.3-29 munsell_0.4.2 proto_0.3-10 <br />[13] RColorBrewer_1.0-5 Rcpp_0.10.4 reshape2_1.2.2 RJSONIO_1.0-3 <br />[17] scales_0.2.3 stringr_0.6.2 tools_3.0.1 xtable_1.7-1 Burhanhttps://www.blogger.com/profile/14493992230463438851noreply@blogger.com