Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
michalovadek authored Sep 11, 2020
1 parent d6a4e3e commit fdb595b
Show file tree
Hide file tree
Showing 21 changed files with 155 additions and 64 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: eurlex
Type: Package
Title: Retrieve Data on European Union Law
Version: 0.3.0
Version: 0.3.1
Authors@R: c(person(given = "Michal",
family = "Ovadek",
role = c("aut", "cre", "cph"),
Expand Down
24 changes: 23 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# eurlex 0.3.1

## Minor changes

- `elx_fetch_data()` now prefers CELEX-based URLs (instead of Cellar URIs) as input, as they appear to yield fewer missing documents

# eurlex 0.3.0

## Major changes
Expand All @@ -12,6 +18,7 @@
## Minor changes

- fixed serious bugs in `elx_curia_list()`
- fixed bug in `elx_label_eurovoc()`

# eurlex 0.2.2

Expand All @@ -23,4 +30,19 @@

## Minor changes

- optimization, reduce dependencies, switch from XML to xml2, etc.
- optimization, reducing dependencies, etc.

# eurlex 0.2.0

## Major changes

- addition of proposals and national implementing laws to possible SPARQL queries
- EuroVoc topics, retrievable in all EU languages, can now be included in SPARQL results
- new date options (force, end of validity, transposition)
- added `elx_curia_list()` to retrieve full list of EU court cases

## Minor changes

- switch from XML to xml2
- SPARQL package dependency removed
- cascading language options for `elx_fetch_data()`
24 changes: 5 additions & 19 deletions R/elx_fetch_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Wraps httr::GET with pre-specified headers to retrieve data.
#'
#' @param url A valid url, preferably to a Cellar work obtained through `elx_run_query`.
#' @param url A valid url based on a resource identifier such as CELEX or Cellar URI.
#' @param type The type of data to be retrieved. When type = "text", the returned list contains named elements reflecting the source of each text.
#' @param language_1 The priority language in which the data will be attempted to be retrieved, in ISO 639 2-char code
#' @param language_2 If data not available in `language_1`, try `language_2`
Expand All @@ -11,7 +11,6 @@
#' @export
#' @examples
#' \donttest{
#' elx_fetch_data(url = ".../resource/cellar/3f7ccca4-478c-4a95-8778-df4243e30d0e", type = "text")
#' elx_fetch_data(url = "http://publications.europa.eu/resource/celex/32014R0001", type = "title")
#' }

Expand Down Expand Up @@ -85,7 +84,10 @@ elx_fetch_data <- function(url, type = c("title","text","ids"),

multiout <- paste0(multiout, collapse = " ---documentbreak--- ")

} else {multiout <- NA_character_}
} else {
multiout <- NA_character_
names(multiout) <- "missingdoc"
}

}

Expand Down Expand Up @@ -200,19 +202,3 @@ elx_read_text <- function(http_response){

}

# testing
# dat <- eurlex::elx_make_query("proposal") %>% eurlex::elx_run_query()
#
# smpl <- sample_n(dat,100)
#
# new <- map(smpl$work,possibly(elx_fetch_data, otherwise = NA_character_),"text")
# smpl[which(map((new),function(x) sum(is.na(x)))==1),3] %>% print(n=100)
#
# unlist(new) %>% enframe() %>% mutate(celex = smpl$celex) %>% filter(name=="multidocs") %>% print(n=150)
#
# multi_url <- smpl[43,1] %>% deframe()
#
# for (i in 150:nrow(smpl)){
# elx_fetch_data(smpl$work[i],"text")
# }

5 changes: 4 additions & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions docs/articles/eurlexpkg.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/articles/eurlexpkg_files/figure-html/wordcloud-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 46 additions & 6 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 1.5.1
pkgdown_sha: ~
articles:
eurlexpkg: eurlexpkg.html
last_built: 2020-09-10T00:16Z
last_built: 2020-09-10T22:55Z

5 changes: 4 additions & 1 deletion docs/reference/elx_council_votes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 16 additions & 13 deletions docs/reference/elx_curia_list.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fdb595b

Please sign in to comment.