Skip to content

Commit

Permalink
Desa taules en xlsx i ods
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaspons committed Nov 28, 2024
1 parent 5bcbd6e commit fcaeb1c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data-raw/becat_cadastre.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ table(comarques$comarca)
comarques <- comarques[, c("municipi", "comarca", "municipi_pdf", "comarca_pdf", "nom_fitxer")]
usethis::use_data(comarques, overwrite = TRUE)

openxlsx::write.xlsx(
comarques,
file = "data-raw/comarques.xlsx", rowNames = FALSE, borders = "surrounding", colWidths = "auto",
firstRow = TRUE, headerStyle = openxlsx::createStyle(textDecoration = "BOLD")
)
readODS::write_ods(comarques, path = "data-raw/comarques.ods", row_names = FALSE)


### Altres dades (data, autors, estat a l'IGN) ----

Expand Down
10 changes: 10 additions & 0 deletions data-raw/fitxers_cadastre.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,15 @@ names(md5sum) <- gsub("^data-raw/pdf/|\\.pdf$", "", names(md5sum))
fitxers_cadastre <- merge(fitxers_cadastre, md5sum, by.x = "municipi", by.y = 0, all = TRUE)
row.names(fitxers_cadastre) <- NULL


## Desa ----

# usethis::use_data(fitxers_cadastre, overwrite = TRUE)
load("data/fitxers_cadastre.rda", verbose = TRUE) # fitxers_cadastre

openxlsx::write.xlsx(
fitxers_cadastre,
file = "data-raw/fitxers_cadastre.xlsx", rowNames = FALSE, borders = "surrounding", colWidths = "auto",
firstRow = TRUE, headerStyle = openxlsx::createStyle(textDecoration = "BOLD")
)
readODS::write_ods(fitxers_cadastre, path = "data-raw/fitxers_cadastre.ods", row_names = FALSE)
7 changes: 7 additions & 0 deletions data-raw/metadades_becat_cadastre.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,10 @@ capçaleres_partides[c("la Roca de l'Albera_CORREGIT", "la Roca de l'Albera_NO C
## Desa ----

usethis::use_data(meta_cadastre, overwrite = TRUE)

openxlsx::write.xlsx(
meta_cadastre,
file = "data-raw/meta_cadastre.xlsx", rowNames = FALSE, borders = "surrounding", colWidths = "auto",
firstRow = TRUE, headerStyle = openxlsx::createStyle(textDecoration = "BOLD")
)
readODS::write_ods(meta_cadastre, path = "data-raw/meta_cadastre.ods", row_names = FALSE)

0 comments on commit fcaeb1c

Please sign in to comment.