Description Usage Arguments Value Examples
This function builds the data frame from the webpage or listURLextractor/rowURLextractor objects.
1 2 3 4 5 6 7 8 9 10 |
x |
link/list/data frame with links. |
bylevel |
define data subsets for an output (i.e. single-member districts); if bylevel=NULL the whole data set is returned. |
ttime |
checks if extracted data covers reported turnout over election day (TRUE) or not (FALSE). |
typedata |
"slow" if the data is extracted from "rezultaty vyborov" link (slow approach); "fast" if the data is extracted from "svodnya tablitsa" (pivot table) (fast approach). |
dnames |
assign original labels to column names(TRUE). |
tabextract |
select the table number to extract in order to override the table selection algorithm. |
savetodir |
save html data files to specified directory, i.e. "C:/Documents". |
messages |
display progress messages (TRUE). |
The list containing the following parameters:
data - data frame or the list of data frames
ttime - input parameter
dnames - input parameter
bylevel - input parameter
retreivaldate - time, date of data retrieval
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(CECscraper)
#Example 1
murl<-"http://notelections.online/region/izbirkom?action=show&vrn=27720002327736®ion=77&prver=0&pronetvd=null"
uiks <- listURLextractor(
rowURLextractor(
listURLextractor(
listURLextractor(murl))[1:5,], 'sayt izbiratel`noy komissii sub`yekta'))
uiks_turnout<-rowURLextractor(uiks, "Dannyye ob otkrytii pomeshcheniy dlya golosovaniya")
uiks_voting<-rowURLextractor(uiks, "Rezul`taty vyborov|vyborov po odnomandatnomu \\(mnogomandatnomu\\) okrugu")
uiks_turnout_data<-dataBuilder(uiks_turnout, bylevel="level1", ttime=TRUE)
uiks_voting_data<-dataBuilder(uiks_voting, bylevel="level1", ttime=FALSE)
uiks_merged<-dataMerger(list(uiks_voting_data,uiks_turnout_data), byrow=FALSE)
#Example 2
# library(dplyr)
# murl="http://notelections.online/region/izbirkom?action=show&global=1&vrn=100100084849062®ion=0&prver=0&pronetvd=null"
#fast_downloadT<-rowURLextractor(murl, "Predvaritel`nyye svedeniya ob uchastii izbirateley")%>%
# listURLextractor()%>%listURLextractor()%>%sample_n(100, replace = FALSE)%>%
# rowURLextractor("sayt izbiratel`noy komissii sub`yekta Rossiyskoy Federatsii")%>%
# dataBuilder(typedata="fast", bylevel="level2", ttime=TRUE)%>%dataMerger()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.