Giter VIP home page Giter VIP logo

datamodules's People

Contributors

andybega avatar

Watchers

 avatar

datamodules's Issues

Parsing dates not working for format %d %B

Scraping doesn't work for dates in the format %d %B (see below). [Non-numerical casualty numbers also throw an error but this is a different issue.]

library("datamodules")
testcase <- wikipedia_terrorism_scrape(from = "1970-01", to = '1970-01')
# Warning messages:
#   1: In wikipedia_terrorism_scrape_table(urls[i]) :
#   Some dates were not parsed
# Table: NULL
# # A tibble: 5 x 2
# orig              date      
# <chr>             <date>    
# 1 26 March          NA        
# 2 April             NA        
# 3 May               NA        
# 4 31 July-August 10 NA        
# 5 12 August         NA        
# 
# 2: In wikipedia_terrorism_scrape_table(urls[i]) :
#
#   Some fatality figures were not parsed
# Table: NULL
# # A tibble: 2 x 2
# dead    dead_min
# <chr>      <dbl>
# 1 (1+)      NA
# 2 Unknown   NA

wiki-terror scraper has issues for earlier years

e.g.

library("datamodules")
#> Artifacts path not set, see `?setup_datamodules()`
foo = wikipedia_terrorism_scrape(from = 2000, to = 2005)
#> Warning in wikipedia_terrorism_scrape_table(urls[i]): Some dates were not parsed
#> Table: NULL
#> # A tibble: 3 x 2
#>   orig  date      
#>   <chr> <date>    
#> 1 14    NA        
#> 2 28    NA        
#> 3 29    NA
#> Warning in wikipedia_terrorism_scrape_table(urls[i]): Some dates were not parsed
#> Table: NULL
#> # A tibble: 8 x 2
#>   orig  date      
#>   <chr> <date>    
#> 1 4     NA        
#> 2 6     NA        
#> 3 8     NA        
#> 4 17    NA        
#> 5 18    NA        
#> 6 24    NA        
#> 7 25    NA        
#> 8 25    NA
#> Warning: Unknown or uninitialised column: 'dead'.
#> Error in `$<-.data.frame`(`*tmp*`, "dead_min", value = numeric(0)): replacement has 0 rows, data has 4

Created on 2019-10-11 by the reprex package (v0.3.0)

This should ultimately work back to 1970 when the data starts (and throw error for input < 1970)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.