-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Version 10.10 * Version 10.10 * Add files via upload
- Loading branch information
Showing
14 changed files
with
3,744 additions
and
3,173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
Package: correspondenceTables | ||
Type: Package | ||
Title: Creating Correspondence Tables Between Two Statistical Classifications | ||
Date: 2022-09-30 | ||
Version: 0.9.9 | ||
Authors@R: c(person("Vasilis", "Chasiotis", role = "aut", comment="Department of Statistics, Athens University of Economics and Business"), | ||
person("Photis", "Stavropoulos", role = "aut", comment="Quantos S.A. Statistics and Information Systems"), | ||
person("Martin", "Karlberg", role = "aut"), | ||
person("Mátyás", "Mészáros", email = "[email protected]", role = "cre"), | ||
person("Martina", "Patone", role = "aut"), | ||
person("Erkand", "Muraku", role = "aut"), | ||
person("Clement", "Thomas", role = "aut"), | ||
person("Loic", "Bienvenu", role = "aut")) | ||
Description: | ||
A candidate correspondence table between two classifications can be created when there are correspondence tables leading from the first classification to the second one via intermediate 'pivot' classifications. | ||
The correspondence table between two statistical classifications can be updated when one of the classifications gets updated to a new version. | ||
License: EUPL | ||
Encoding: UTF-8 | ||
Imports: data.table, httr, tidyverse, writexl, stringr, igraph, tools | ||
Suggests: | ||
knitr, | ||
rmarkdown, | ||
tinytest | ||
VignetteBuilder: knitr | ||
NeedsCompilation: no | ||
URL: https://github.com/eurostat/correspondenceTables | ||
BugReports: https://github.com/eurostat/correspondenceTables/issues | ||
Maintainer: Mátyás Mészáros <[email protected]> | ||
RoxygenNote: 7.2.3 | ||
Package: correspondenceTables | ||
Type: Package | ||
Title: Creating Correspondence Tables Between Two Statistical Classifications | ||
Date: 2022-09-30 | ||
Version: 0.10.10 | ||
Authors@R: c(person("Vasilis", "Chasiotis", role = "aut", comment="Department of Statistics, Athens University of Economics and Business"), | ||
person("Photis", "Stavropoulos", role = "aut", comment="Quantos S.A. Statistics and Information Systems"), | ||
person("Martin", "Karlberg", role = "aut"), | ||
person("Mátyás", "Mészáros", email = "[email protected]", role = "cre"), | ||
person("Martina", "Patone", role = "aut"), | ||
person("Erkand", "Muraku", role = "aut"), | ||
person("Clement", "Thomas", role = "aut"), | ||
person("Loic", "Bienvenu", role = "aut")) | ||
Description: | ||
A candidate correspondence table between two classifications can be created when there are correspondence tables leading from the first classification to the second one via intermediate 'pivot' classifications. | ||
The correspondence table between two statistical classifications can be updated when one of the classifications gets updated to a new version. | ||
License: EUPL | ||
Encoding: UTF-8 | ||
Imports: data.table, httr, stringr, igraph, tools | ||
Suggests: | ||
knitr, | ||
rmarkdown, tinytest | ||
VignetteBuilder: knitr | ||
NeedsCompilation: no | ||
URL: https://github.com/eurostat/correspondenceTables | ||
BugReports: https://github.com/eurostat/correspondenceTables/issues | ||
Maintainer: Mátyás Mészáros <[email protected]> | ||
RoxygenNote: 7.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
check_n_columns <- function(df, source, num_columns) { | ||
caller <- sys.call(-1) #define the caller function | ||
tryCatch({ | ||
if (ncol(df) < num_columns) { | ||
stop(paste("In",as.character(caller[1]), ", the data", source, " has less than the minimum required ", num_columns, "columns.")) | ||
} else if (ncol(df) > num_columns) { | ||
warning(paste("In", as.character(caller[1]),", the data", source, " has more than", num_columns, "columns.")) | ||
} else { | ||
#print(paste("The data", source, " has exactly", num_columns, "columns.")) | ||
} | ||
}, error = function(e) { | ||
print(paste("Error:", e$message)) | ||
}, warning = function(e) { | ||
print(paste("Warning:", e$message)) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
CsvFileSave <- function(CSVpath, OutputDF) { | ||
if (!is.null(CSVpath)) { | ||
|
||
# Check if the file exists and prompt for overwrite confirmation | ||
if (file.exists(CSVpath)) { | ||
cat("A CSV file with the same name already exists.\n") | ||
cat("Warning: This action will overwrite the existing file.\n") | ||
|
||
proceed <- "" | ||
while (!(proceed %in% c("y", "n"))) { | ||
proceed <- tolower(readline("Do you want to proceed? (y/n): ")) | ||
if (!(proceed %in% c("y", "n"))) { | ||
cat("Invalid input. Please enter 'y' or 'n'.\n") | ||
} | ||
} | ||
|
||
if (proceed != "y") { | ||
cat("Operation aborted.\n") | ||
return(NULL) | ||
} | ||
} | ||
# Try to write the CSV file with error handling | ||
tryCatch({ | ||
write.csv(OutputDF, CSVpath, row.names = FALSE) | ||
cat("The table was saved in", CSVpath, "\n") | ||
}, error = function(e) { | ||
cat("An error occurred while writing to the file:\n") | ||
cat(e$message, "\n") | ||
}) | ||
} | ||
} |
Oops, something went wrong.