Skip to contents

Introduction

The goal of BOE is to provide tools to retrieve data from BOE the official gazette of Spain. Since 2009 the online documents have all the legal validation, but documents published before are accessible from the website too.

The main purpose of this program is to make easily accessible the publications the Agencia Estatal Boletín del Estado provides as the legal and valid source of law. It provides functions to tidy the sumario and retrieve the individual “.pdf” of each publication and summaries. To retrieve a document we need the publication code. For summaries we can use two types of codes BOE-S-YYYYMMDD and BOE-S-YYYY-NNN. The first one is useful to retrieve a document of certain date and can be created with sumario_nbo(). The second one is the CVE the code that can be verified online, it can be created with sumario_cve(). Note at most there is one sumario per day, so 365 is the max, but usually none is published on Sundays.

At the same site we can access the BORME which is another journal to register of organizations commercial activity. The summaries from this journal can also be retrieved using the option journal = "BORME". This journal publishes only from Monday to Saturday.

There is a mix of words in the package I left the document names in Spanish but changed the verbs to English. Hope it is easier this way for Spanish speaking people if it is not for you open an issue and let me know.

Sumario

It is a summary of the publications of the day with information about the summary number, section, department, epigraph, brief text of the publication, publication’s number of pages of the pdf.

The easiest way to get a sumario is using retrieve_sumario():

library("BOE")
today <- Sys.Date()
# On Sunday there is not BOE unless there is an extraodinary publication
if (weekdays(today) == "Sunday") {
    today <- today - 1
}

sumario_hoy <- retrieve_sumario(today)
head(sumario_hoy)
#>         date sumario_nbo   sumario_code section
#> 1 2022-08-04         186 BOE-S-2022-186       1
#> 2 2022-08-04         186 BOE-S-2022-186       1
#> 3 2022-08-04         186 BOE-S-2022-186       1
#> 4 2022-08-04         186 BOE-S-2022-186       1
#> 5 2022-08-04         186 BOE-S-2022-186       1
#> 6 2022-08-04         186 BOE-S-2022-186      2A
#>                                                              section_number
#> 1                                                I. Disposiciones generales
#> 2                                                I. Disposiciones generales
#> 3                                                I. Disposiciones generales
#> 4                                                I. Disposiciones generales
#> 5                                                I. Disposiciones generales
#> 6 II. Autoridades y personal. - A. Nombramientos, situaciones e incidencias
#>                                              departament departament_etq
#> 1                                  MINISTERIO DE DEFENSA            6110
#> 2                                  MINISTERIO DE DEFENSA            6110
#> 3 MINISTERIO DE AGRICULTURA, PESCA Y ALIMENTACI<U+00D3>N            3120
#> 4 MINISTERIO DE AGRICULTURA, PESCA Y ALIMENTACI<U+00D3>N            3120
#> 5        COMISI<U+00D3>N NACIONAL DEL MERCADO DE VALORES            1040
#> 6              MINISTERIO DE POL<U+00CD>TICA TERRITORIAL            9523
#>                                               epigraph
#> 1                             Bandera de Espa<U+00F1>a
#> 2 Centros docentes militares. Formaci<U+00F3>n militar
#> 3                                               Ayudas
#> 4                                Pesca mar<U+00ED>tima
#> 5          Instituciones de inversi<U+00F3>n colectiva
#> 6                                             Destinos
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        text
#> 1                                                                                                                                                                                                                                                                                                                                                                                                                                                       Orden DEF/750/2022, de 28 de julio, que modifica la Orden DEF/1445/2004, de 16 de mayo, por la que se establece el procedimiento para que los espa<U+00F1>oles puedan solicitar y realizar el juramento o promesa ante la Bandera de Espa<U+00F1>a.
#> 2 Orden DEF/751/2022, de 28 de julio, por la que se modifican la Orden DEF/85/2017, de 1 de febrero, por la que se aprueban las normas sobre organizaci<U+00F3>n y funciones, r<U+00E9>gimen interior y programaci<U+00F3>n de los centros docentes militares; y la Orden DEF/368/2017, de 4 de abril, por la que se aprueba el R<U+00E9>gimen del Alumnado de la ense<U+00F1>anza de formaci<U+00F3>n y se modifica la Orden DEF/1626/2015, de 29 de julio, por la que se aprueban las directrices generales para la elaboraci<U+00F3>n de los curr<U+00ED>culos de la ense<U+00F1>anza de formaci<U+00F3>n para el acceso a las diferentes escalas de suboficiales de los cuerpos de las Fuerzas Armadas.
#> 3                                                                                                                                                                                                                                                                 Correcci<U+00F3>n de errores del Real Decreto 948/2021, de 2 de noviembre, por el que se establecen las bases reguladoras para la concesi<U+00F3>n de ayudas estatales destinadas a la ejecuci<U+00F3>n de proyectos de inversi<U+00F3>n dentro del Plan de impulso de la sostenibilidad y competitividad de la agricultura y la ganader<U+00ED>a (III) en el marco del Plan de Recuperaci<U+00F3>n, Transformaci<U+00F3>n y Resiliencia.
#> 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Correcci<U+00F3>n de errores del Real Decreto 502/2022, de 27 de junio, por el que se regula el ejercicio de la pesca en los caladeros nacionales.
#> 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                     Circular 3/2022, de 21 de julio, de la Comisi<U+00F3>n Nacional del Mercado de Valores, sobre el folleto de las instituciones de inversi<U+00F3>n colectiva y el registro del documento con los datos fundamentales para el inversor.
#> 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Resoluci<U+00F3>n de 28 de julio de 2022, de la Subsecretar<U+00ED>a, por la que se resuelve parcialmente la convocatoria de libre designaci<U+00F3>n, efectuada por Resoluci<U+00F3>n de 12 de mayo de 2022.
#>        publication pages
#> 1 BOE-A-2022-13107     1
#> 2 BOE-A-2022-13108    12
#> 3 BOE-A-2022-13109     1
#> 4 BOE-A-2022-13110     1
#> 5 BOE-A-2022-13111    33
#> 6 BOE-A-2022-13112     2

Publications

Once you select those publications we can obtain the links for the pdf.

url_publications(sumario_hoy[1:5, ])
#> [1] "https://boe.es/boe/dias/2022/08/04/pdfs/BOE-A-2022-13107.pdf"
#> [2] "https://boe.es/boe/dias/2022/08/04/pdfs/BOE-A-2022-13108.pdf"
#> [3] "https://boe.es/boe/dias/2022/08/04/pdfs/BOE-A-2022-13109.pdf"
#> [4] "https://boe.es/boe/dias/2022/08/04/pdfs/BOE-A-2022-13110.pdf"
#> [5] "https://boe.es/boe/dias/2022/08/04/pdfs/BOE-A-2022-13111.pdf"

Or you can also create the CVE and then look them up on the database:

anuncio_cve("2019", 5)
#> [1] "BOE-B-2019-5"
disposicion_cve("2010", 4565)
#> [1] "BOE-A-2010-4565"

If you know the date of publication we can obtain the url for the pdf:

cve <- disposicion_cve("2017", "11117")
query_pdf("2017", "10", "02", cve)
#> [1] "https://boe.es/boe/dias/2017/10/02/pdfs/BOE-A-2017-11117.pdf"

Check it here.

Check codes

Before querying the BOE the codes submitted are checked to know if they are valid. If you have some code and want to check it you can use check_code():

check_code("BOE-A-1968970")
#> Error: The code should have three 3 '-'.
check_code("BOE-A-19-68970")
#> [1] TRUE

If you code is not valid it won’t be requested to the website, and the error indicates what is wrong with the code.

Session Info

sessionInfo()
#> R version 4.2.1 (2022-06-23)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur ... 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] C/C/C/C/C/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] BOE_0.1.8.9004
#> 
#> loaded via a namespace (and not attached):
#>  [1] xml2_1.3.3        knitr_1.39        magrittr_2.0.3    R6_2.5.1         
#>  [5] ragg_1.2.2        rlang_1.0.4       fastmap_1.1.0     httr_1.4.3       
#>  [9] stringr_1.4.0     tools_4.2.1       xfun_0.31         cli_3.3.0        
#> [13] jquerylib_0.1.4   htmltools_0.5.3   systemfonts_1.0.4 yaml_2.3.5       
#> [17] digest_0.6.29     rprojroot_2.0.3   pkgdown_2.0.6     textshaping_0.3.6
#> [21] purrr_0.3.4       sass_0.4.2        fs_1.5.2          curl_4.3.2       
#> [25] memoise_2.0.1     cachem_1.0.6      evaluate_0.15     rmarkdown_2.14   
#> [29] stringi_1.7.8     compiler_4.2.1    bslib_0.4.0       desc_1.4.1       
#> [33] jsonlite_1.8.0