andybega / datamodules Goto Github PK
View Code? Open in Web Editor NEWInfrastructure for data modules and miscellaneous data getters
License: Other
Infrastructure for data modules and miscellaneous data getters
License: Other
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
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.