Title: | Prepare Housing Data for Analysis |
---|---|
Description: | Prepares census and core housing needs data, specifically designed for use with Statistics Canada data and standardized input data. The package offers functions for tidying, organizing, and splitting complex data tables, making it easier for users to perform analyses on the data. 'OHCSpackage''' is particularly useful for those working with census data that has a consistent format, number of rows, and number of columns. With this package, users can save time and streamline their data preparation processes. |
Authors: | Ilythia Morley [aut, cre, cph], Eric Borthistle cre [aut] |
Maintainer: | Ilythia Morley <[email protected]> |
License: | GPL-3 |
Version: | 0.1.5 |
Built: | 2024-11-02 03:26:12 UTC |
Source: | https://github.com/cran/OHCSpackage |
This function takes a path to a directory containing CSV files of census data tables, and a path to an output directory. It cleans the data tables and exports them as Excel files to the output directory.
prepare_census_tables(input_path, output_path, write_output = FALSE)
prepare_census_tables(input_path, output_path, write_output = FALSE)
input_path |
Path to directory containing input CSV files |
output_path |
Path to output directory for Excel files |
write_output |
Logical, indicating whether or not to write the output to file (default: FALSE) |
If write_to_file is TRUE, a list of file paths for the Excel filesw will be produced.
temp_dir <- tempdir() file_path <- paste0(temp_dir, "/", "outputs/") prepare_census_tables(system.file("extdata/census_data", package = "OHCSpackage"), file_path, write_output = TRUE)
temp_dir <- tempdir() file_path <- paste0(temp_dir, "/", "outputs/") prepare_census_tables(system.file("extdata/census_data", package = "OHCSpackage"), file_path, write_output = TRUE)
This function reads in a table of data on core housing needs by municipality and creates a combined table that separates out each variable in the data into its own column. The resulting table is exported as a CSV file if write_output is TRUE.
prepare_core_housing_needs_tables( input_path, output_path = NULL, write_output = TRUE )
prepare_core_housing_needs_tables( input_path, output_path = NULL, write_output = TRUE )
input_path |
Path to the input CSV file. |
output_path |
Path to save the output CSV file. If NULL, the file will be saved in the same directory as the input file with the name "combined_table.csv". |
write_output |
Logical. Should the combined table be written to a file? Default is TRUE. |
A data frame containing the combined data.