Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propuesta de mejoras #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dieghernan
Copy link
Member

Hola @edugonzaloalmorox

Muchas gracias por añadir tu paquete a rOpenSpain. Hemos visto que enseResp daba algunos errores cuando se ejecutaba R CMD check (detalle).

Te adjunto un PR para arreglar esto y además para generar el sitio pkgdown correctamente:

Acciones realizadas

  • He vuelto a generar la documentación con roxygen2, estaba desactualizada
  • He añadido algunas carpetas que no son estandar en los paquetes R en .Rbuildignore (documentation, funs, logo, pkgdown).
  • Además, he actualizado la definición de los autores en DESCRIPTION a la nueva nomencaltura de R
  • He actualizado la información de la licencia. También daba errores.
  • He re-comprimido todos los archivos en data usando resaveRdafiles() (mas aqui)
  • He actualizado las urls de los repos a la nueva localización del repositorio: rOpenSpain/enseResp
  • Mejoras en el README.Rmd: tamaño del logo e imágenes mas claras
  • Adicionalmente he incluido una acción que comprueba tu paquete 'R CMD check' con cada nuevo commit.
  • Por último, he regenerado la documentación pkgdown

Una cosa más, recuerda que para que la documentación pkgdown del paquete esté disponible como página web, tienes que hacer una acción adicional:

  • Ve en el repo a Settings > Page y, en tu caso, elige Branch -> master docs

Una preview del sitio en mi fork:

https://dieghernan.github.io/enseResp/

Saludos y gracias

Copy link
Collaborator

@edugonzaloalmorox edugonzaloalmorox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muchas gracias @dieghernan.
¿Hay algún sitio donde estén documentadas estas buenas prácticas? Desde luego mejoran sustancialmente el paquete.
He incluido la sugerencia en los settings para que el paquete esté disponible como página web.

@dieghernan
Copy link
Member Author

dieghernan commented Mar 6, 2023

Principalemente en las recomendaciones de CRAN https://cran.r-project.org/doc/manuals/R-exts.html Te dejo algunas referencias aunque es bastante extenso

Y revisión de los errores que te referencié en el comentario anterior

@dieghernan
Copy link
Member Author

Y el detalle del check inicial:

R CMD check
* using log directory 'D:/a/ropenspain/ropenspain/enseResp.Rcheck'
* using R version 4.2.2 (2022-10-31 ucrt)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: UTF-8
* using options '--no-manual --no-build-vignettes'
* checking for file 'enseResp/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'enseResp' version '0.1.0'
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... WARNING
Warning: Found the following files with non-portable file names:
  documentation/ense06/Adulto-ENSE-[200](https://github.com/r-universe/ropenspain/actions/runs/4337992714/jobs/7574402564#step:8:209)6/Cuestionario Adultos 2006.pdf
  documentation/ense06/Adulto-ENSE-2006/Registro Adultos 2006.pdf
  documentation/ense06/Hogar-ENSE-2006/Cuestionario Hogar 2006.pdf
  documentation/ense06/Hogar-ENSE-2006/Registro Hogar 2006.pdf
  documentation/ense06/Infantil-ENSE-2006/Cuestionario Menores 2006.pdf
  documentation/ense06/Infantil-ENSE-2006/Registro Menores 2006.pdf
  documentation/ense12/datos_ensalud12/MICRODATO ADULTO ANONIMIZADO.txt
  documentation/ense12/datos_ensalud12/MICRODATO HOGAR ANONIMIZADO.txt
  documentation/ense12/datos_ensalud12/MICRODATO MENOR ANONIMIZADO.txt
  documentation/ense12/disreg_ensalud12/DISENO ADULTOS ENSE [201](https://github.com/r-universe/ropenspain/actions/runs/4337992714/jobs/7574402564#step:8:210)1-2012.xls
  documentation/ense12/disreg_ensalud12/DISENO HOGAR ENSE 2011-2012.xls
  documentation/ense12/disreg_ensalud12/DISENO MENORES ENSE 2011-2012.xls
  documentation/ense17/Adultos_2017/Diseno registro ADULTO ENSE 2017_PUBLICACION.xlsx
  documentation/ense17/Adultos_2017/~$Diseno registro ADULTO ENSE 2017_PUBLICACION.xlsx
  documentation/ense17/Hogar_ENSE17/Diseno registro HOGAR ENSE 2017_PUBLICACION.xlsx
  documentation/ense17/Hogar_ENSE17/~$Diseno registro HOGAR ENSE 2017_PUBLICACION.xlsx
  documentation/ense17/Menores_ENSE17/Diseno registro MENOR ENSE 2017_PUBLICACION.xls
These are not fully portable file names.
See section 'Package structure' in the 'Writing R Extensions' manual.
* checking whether package 'enseResp' can be installed ... OK
* checking installed package size ... NOTE
  installed size is 17.8Mb
  sub-directories of 1Mb or more:
    data  17.5Mb
* checking package directory ... OK
* checking DESCRIPTION meta-information ... NOTE
License components which are templates and need '+ file LICENSE':
  MIT License
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... WARNING
Warning: Undocumented code objects:
  'adults_06' 'adults_06_info' 'adults_06_labels' 'adults_12'
  'adults_12_info' 'adults_12_labels' 'adults_19_labels' 'children_06'
  'children_06_info' 'children_06_labels' 'children_12'
  'children_12_info' 'children_12_labels' 'children_19_labels'
  'house_06_labels' 'household_06' 'household_06_info' 'household_12'
  'household_12_info' 'household_12_labels' 'household_19_labels'
  'regional_map'
Undocumented data sets:
  'adults_06' 'adults_06_info' 'adults_06_labels' 'adults_12'
  'adults_12_info' 'adults_12_labels' 'adults_19_labels' 'children_06'
  'children_06_info' 'children_06_labels' 'children_12'
  'children_12_info' 'children_12_labels' 'children_19_labels'
  'house_06_labels' 'household_06' 'household_06_info' 'household_12'
  'household_12_info' 'household_12_labels' 'household_19_labels'
  'regional_map'
All user-level objects in a package should have documentation entries.
See chapter 'Writing R documentation files' in the 'Writing R
Extensions' manual.
* checking for code/documentation mismatches ... WARNING
Warning: Functions or methods with usage in documentation object 'get_region' but not in code:
  'get_region'

Functions or methods with usage in documentation object 'get_variable' but not in code:
  'get_variable'

Data codoc mismatches from documentation object 'adults_19':
Variables in data frame 'adults_19'
  Code: A7_2a ACTIVa CCAA CLASE_PR CMD1 CMD2 CMD3 E1_1 E2_1a E2_1b
        E2_1c E2_1d E3 E4 E4b EDADa F10 F11 F12 F13 F14a F14b F15 F16
        F17 F18a_2 F18b_2 F19a_2 F19b_2 F20 F6 F7 F8_2 F9_2
        FACTORADULTO G21 G22 G23 G24 G25a_1 G25a_10 G25a_11 G25a_12
        G25a_13 G25a_14 G25a_15 G25a_16 G25a_17 G25a_18 G25a_19 G25a_2
        G25a_20 G25a_21 G25a_22 G25a_23 G25a_24 G25a_25 G25a_26 G25a_27
        G25a_28 G25a_29 G25a_3 G25a_30 G25a_31 G25a_32 G25a_4 G25a_5
        G25a_6 G25a_7 G25a_8 G25a_9 G25b_1 G25b_10 G25b_11 G25b_12
        G25b_13 G25b_14 G25b_15 G25b_16 G25b_17 G25b_18 G25b_19 G25b_2
        G25b_20 G25b_21 G25b_22 G25b_23 G25b_24 G25b_25 G25b_26 G25b_27
        G25b_28 G25b_29 G25b_3 G25b_30 G25b_31 G25b_32 G25b_4 G25b_5
        G25b_6 G25b_7 G25b_8 G25b_9 G25c_1 G25c_10 G25c_11 G25c_12
        G25c_13 G25c_14 G25c_15 G25c_16 G25c_17 G25c_18 G25c_19 G25c_2
        G25c_20 G25c_21 G25c_22 G25c_23 G25c_24 G25c_25 G25c_26 G25c_27
        G25c_28 G25c_29 G25c_3 G25c_30 G25c_31 G25c_32 G25c_4 G25c_5
        G25c_6 G25c_7 G25c_8 G25c_9 H26_1 H26_2 H26_3 H27 I28_1 I28_2
        I29_1 I29_2 IDENTHOGAR IMCa K32 K33 K34 K35 K36 K37 K38 K38a
        L39_1 L39_2 L39_3 L39_4 L39_5 L40 L41 L42_1 L42_2 L42_3 L42_4
        L42_5 L42_6 L42_7 L43 L44 L45 L46 M47_1 M47_10 M47_11 M47_12
        M47_2 M47_3 M47_4 M47_5 M47_6 M47_7 M47_8 M47_9 M47a M47b N48
        N49 N50 N51 N52 N53 N54 N55_1 N55_2 N55_3 N56_1 N56_2 N56_3 N57
        N58_1 N58_2 N58_3 N59 N60_1 N60_2 N60_3 N60_4 N60a_1 N60a_2
        N60a_3 N60a_4 N61_1 N61_2 N61_3 N61_4 N61_5 N62 N62b N63_1
        N63_10 N63_2 N63_3 N63_4 N63_5 N63_6 N63_7 N63_8 N63_9 N64
        N65_1 N65_2 N65_3 N65_4 N65_5 N65_6 N65_7 N65_8 NIVEST O66 O67
        O69 O70 O71 O72 O73 O74 O75 O76 O77 O78 O79 O80_1 O80_2 O80_3
        O81_1 O81_2 O81_3 O82_1 O82_2 O83 O84_1 O84_2 O84_3 O84_4 O84_5
        O84_6 O84_7 O84_8 O84_9 P85 P86 P87_10a P87_10b P87_11a P87_11b
        P87_12a P87_12b P87_13a P87_13b P87_14a P87_14b P87_15a P87_15b
        P87_16a P87_16b P87_17a P87_17b P87_18a P87_18b P87_19a P87_19b
        P87_1a P87_1b P87_20a P87_20b P87_21a P87_21b P87_22a P87_22b
        P87_23a P87_23b P87_2a P87_2b P87_3a P87_3b P87_4a P87_4b
        P87_5a P87_5b P87_6a P87_6b P87_7a P87_7b P87_8a P87_8b P87_9a
        P87_9b PROXY_0 PROXY_1 PROXY_2 PROXY_2b PROXY_3b PROXY_4
        PROXY_5 Q100 Q101 Q102 Q103 Q104 Q105 Q88 Q89 Q90 Q91 Q92 Q93
        Q94 Q95 Q96 Q97 Q98 Q99 R106 R107 R108_1 R108_2 R108_3 R108_4
        S109 S110 SEXOa T111 T112 T113 T114_1 T114_2 T115 T116_1 T116_2
        T117 T118_1 T118_2 T119_1 T119_2 U120CANTFZ U120FZ U120_1
        U120_10 U120_11 U120_12 U120_13 U120_14 U120_15 U120_15a
        U120_1a U120_2 U120_3 U120_4 U120_5 U120_6 U120_7 U120_7a
        U120_8 U120_9 U2_120F V121 V122 V123 V124 V125 V126 W127
        W128Cer W128Cer_1 W128Cer_2 W128Cer_3 W128Cer_4 W128Cer_5
        W128Cer_6 W128Cer_7 W128Comb W128Comb_1 W128Comb_2 W128Comb_3
        W128Comb_4 W128Comb_5 W128Comb_6 W128Comb_7 W128Lic W128Lic_1
        W128Lic_2 W128Lic_3 W128Lic_4 W128Lic_5 W128Lic_6 W128Lic_7
        W128Sidra W128Sidra_1 W128Sidra_2 W128Sidra_3 W128Sidra_4
        W128Sidra_5 W128Sidra_6 W128Sidra_7 W128Vermut W128Vermut_1
        W128Vermut_2 W128Vermut_3 W128Vermut_4 W128Vermut_5
        W128Vermut_6 W128Vermut_7 W128Vin W128Vin_1 W128Vin_2 W128Vin_3
        W128Vin_4 W128Vin_5 W128Vin_6 W128Vin_7 W129 X130_1 X130_10
        X130_11 X130_2 X130_3 X130_4 X130_5 X130_6 X130_7 X130_8 X130_9
        Y133 Y134 Y135
  Docs: A7_2a ACTIVa CCAA CLASE_PR CMD1 CMD2 CMD3 E1_1 E2_1a E2_1b
        E2_1c E2_1d E3 E4 E4b EDADa F10 F11 F12 F13 F14a F14b F15 F16
        F17 F18a_2 F18b_2 F19a_2 F19b_2 F20 F6 F7 F8_2 F9_2
        FACTORADULTO G21 G22 G23 G24 G25a_1 G25a_10 G25a_11 G25a_12
        G25a_13 G25a_14 G25a_15 G25a_16 G25a_17 G25a_18 G25a_19 G25a_2
        G25a_20 G25a_21 G25a_22 G25a_23 G25a_24 G25a_25 G25a_26 G25a_27
        G25a_28 G25a_29 G25a_3 G25a_30 G25a_31 G25a_32 G25a_4 G25a_5
        G25a_6 G25a_7 G25a_8 G25a_9 G25b_1 G25b_10 G25b_11 G25b_12
        G25b_13 G25b_14 G25b_15 G25b_16 G25b_17 G25b_18 G25b_19 G25b_2
        G25b_20 G25b_21 G25b_22 G25b_23 G25b_24 G25b_25 G25b_26 G25b_27
        G25b_28 G25b_29 G25b_3 G25b_30 G25b_31 G25b_32 G25b_4 G25b_5
        G25b_6 G25b_7 G25b_8 G25b_9 G25c_1 G25c_10 G25c_11 G25c_12
        G25c_13 G25c_14 G25c_15 G25c_16 G25c_17 G25c_18 G25c_19 G25c_2
        G25c_20 G25c_21 G25c_22 G25c_23 G25c_24 G25c_25 G25c_26 G25c_27
        G25c_28 G25c_29 G25c_3 G25c_30 G25c_31 G25c_32 G25c_4 G25c_5
        G25c_6 G25c_7 G25c_8 G25c_9 H26_1 H26_2 H26_3 H27 I28_1 I28_2
        I29_1 I29_2 IDENTHOGAR IMCa K32 K33 K34 K35 K36 K37 K38 K38a
        L39_1 L39_2 L39_3 L39_4 L39_5 L40 L41 L42_1 L42_2 L42_3 L42_4
        L42_5 L42_6 L42_7 L43 L44 L45 L46 M47_1 M47_10 M47_11 M47_12
        M47_2 M47_3 M47_4 M47_5 M47_6 M47_7 M47_8 M47_9 M47a M47b N48
        N49 N50 N51 N52 N53 N54 N55_1 N55_2 N55_3 N56_1 N56_2 N56_3 N57
        N58_1 N58_2 N58_3 N59 N60_1 N60_2 N60_3 N60_4 N60a_1 N60a_2
        N60a_3 N60a_4 N61_1 N61_2 N61_3 N61_4 N61_5 N62 N62b N63_1
        N63_10 N63_2 N63_3 N63_4 N63_5 N63_6 N63_7 N63_8 N63_9 N64
        N65_1 N65_2 N65_3 N65_4 N65_5 N65_6 N65_7 N65_8 NIVEST O66 O67
        O69 O70 O71 O72 O73 O74 O75 O76 O77 O78 O79 O80_1 O80_2 O80_3
        O81_1 O81_2 O81_3 O82_1 O82_2 O83 O84_1 O84_2 O84_3 O84_4 O84_5
        O84_6 O84_7 O84_8 O84_9 P85 P86 P87_10a P87_10b P87_11a P87_11b
        P87_12a P87_12b P87_13a P87_13b P87_14a P87_14b P87_15a P87_15b
        P87_16a P87_16b P87_17a P87_17b P87_18a P87_18b P87_19a P87_19b
        P87_1a P87_1b P87_20a P87_20b P87_21a P87_21b P87_22a P87_22b
        P87_23a P87_23b P87_2a P87_2b P87_3a P87_3b P87_4a P87_4b
        P87_5a P87_5b P87_6a P87_6b P87_7a P87_7b P87_8a P87_8b P87_9a
        P87_9b PROXY_0 PROXY_0 PROXY_1 PROXY_2 PROXY_2b PROXY_3b
        PROXY_4 PROXY_5 Q100 Q101 Q102 Q103 Q104 Q105 Q88 Q89 Q90 Q91
        Q92 Q93 Q94 Q95 Q96 Q97 Q98 Q99 R106 R107 R108_1 R108_2 R108_3
        R108_4 S109 S110 SEXOa T111 T112 T113 T114_1 T114_2 T115 T116_1
        T116_2 T117 T118_1 T118_2 T119_1 T119_2 U120CANTFZ U120FZ
        U120_1 U120_10 U120_11 U120_12 U120_13 U120_14 U120_15 U120_15a
        U120_1a U120_2 U120_3 U120_4 U120_5 U120_6 U120_7 U120_7a
        U120_8 U120_9 U2_120F V121 V122 V123 V124 V125 V126 W127
        W128Cer W128Cer_1 W128Cer_2 W128Cer_3 W128Cer_4 W128Cer_5
        W128Cer_6 W128Cer_7 W128Comb W128Comb_1 W128Comb_2 W128Comb_3
        W128Comb_4 W128Comb_5 W128Comb_6 W128Comb_7 W128Lic W128Lic_1
        W128Lic_2 W128Lic_3 W128Lic_4 W128Lic_5 W128Lic_6 W128Lic_7
        W128Sidra W128Sidra_1 W128Sidra_2 W128Sidra_3 W128Sidra_4
        W128Sidra_5 W128Sidra_6 W128Sidra_7 W128Vermut W128Vermut_1
        W128Vermut_2 W128Vermut_3 W128Vermut_4 W128Vermut_5
        W128Vermut_6 W128Vermut_7 W128Vin W128Vin_1 W128Vin_2 W128Vin_3
        W128Vin_4 W128Vin_5 W128Vin_6 W128Vin_7 W129 X130_1 X130_10
        X130_11 X130_2 X130_3 X130_4 X130_5 X130_6 X130_7 X130_8 X130_9
        Y133 Y134 Y135

Data codoc mismatches from documentation object 'adults_19_info':
Variables in data frame 'adults_19_info'
  Code: descripcion_del_campo longitud posicion_final posicion_inicio
        tipo_variable variable_ine
  Docs: descripcion_del_campo longitud modulo posicion_final
        posicion_inicio tipo_variable variable_ine

* checking Rd \usage sections ... WARNING
Warning: Undocumented arguments in documentation object 'get_region'
  'df'

Undocumented arguments in documentation object 'get_variable'
  'df'

Functions with \usage entries need to have the appropriate \alias
entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See chapter 'Writing R documentation files' in the 'Writing R
Extensions' manual.
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... WARNING
Warning:   Note: found 5866 marked UTF-8 strings
  Warning: found non-ASCII strings
  'Andaluc<c3><ad>a' in object 'regional_map'
  'Arag<c3><b3>n' in object 'regional_map'
  'Castilla y Le<c3><b3>n' in object 'regional_map'
  'Catalu<c3><b1>a' in object 'regional_map'
  'Pa<c3><ad>s Vasco' in object 'regional_map'
  'Regi<c3><b3>n de Murcia' in object 'regional_map'
* checking LazyData ... WARNING
Warning:   LazyData DB of 17.5 MB without LazyDataCompression set
  See §1.1.6 of 'Writing R Extensions'
* checking data for ASCII and uncompressed saves ... OK
* checking examples ... ERROR
Error: Running examples in 'enseResp-Ex.R' failed
The error most likely occurred in:

> ### Name: get_variable
> ### Title: Obtains data by the type of variable in the survey.
> ### Aliases: get_variable
> 
> ### ** Examples
> 
> get_variable(adult, variable = "care")
Error in get_variable(adult, variable = "care") : 
  could not find function "get_variable"
Execution halted
* DONE

Status: 1 ERROR, 6 WARNINGs, 2 NOTEs
See
  'D:/a/ropenspain/ropenspain/enseResp.Rcheck/00check.log'
for details.

@dieghernan
Copy link
Member Author

Estructura del paquete:

https://cran.r-project.org/doc/manuals/R-exts.html#Package-structure

The sources of an R package consist of a subdirectory containing the files DESCRIPTION and NAMESPACE, and the subdirectories R, data, demo, exec, inst, man, po, src, tests, tools and vignettes (some of which can be missing, but which should not be empty). The package subdirectory may also contain files INDEX, configure, cleanup, LICENSE, LICENCE and NEWS. Other files such as INSTALL (for non-standard installation instructions), README/README.md2, or ChangeLog will be ignored by R, but may be useful to end users. The utility R CMD build may add files in a build directory (but this should not be used for other purposes).

@dieghernan
Copy link
Member Author

Y tu pagina web (tal cual está ahora mismo) https://ropenspain.github.io/enseResp/

@dieghernan
Copy link
Member Author

Finalmente, aunque no es vinculante, puedes echar un vistazo a nuestra guia de estilo: https://ropenspain.es/docs/guia_estilo/ especialmente a las secciones Documentación, Autoría y Testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants