| Type: | Package |
| Title: | Philippine Statistical Classification Systems |
| Version: | 0.1.0 |
| Description: | A unified interface to access and manipulate various Philippine statistical classifications. It allows users to retrieve, filter, and harmonize classification data, making it easier to work with Philippine statistical data in R. |
| Author: | Bhas Abdulsamad |
| Maintainer: | Bhas Abdulsamad <aeabdulsamad@gmail.com> |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Imports: | purrr (≥ 1.0.2), jsonlite (≥ 1.8.8), dplyr (≥ 1.1.0), tidyr (≥ 1.3.1), stringr (≥ 1.4.0) |
| Suggests: | rlang (≥ 1.0.2), testthat (≥ 3.0.0), utils (≥ 4.0.0), cli, gt, rmarkdown, knitr |
| Config/testthat/edition: | 3 |
| RoxygenNote: | 7.3.3 |
| Depends: | R (≥ 4.1.0) |
| VignetteBuilder: | knitr |
| BugReports: | https://github.com/yng-me/phscs/issues |
| URL: | https://yng-me.github.io/phscs/, https://github.com/yng-me/phscs |
| NeedsCompilation: | no |
| Packaged: | 2025-11-05 17:03:05 UTC; bhasabdulsamad |
| Repository: | CRAN |
| Date/Publication: | 2025-11-09 16:40:02 UTC |
Philippine Classification of Individual Consumption According to Purpose (PCOICOP)
Description
Philippine Classification of Individual Consumption According to Purpose (PCOICOP)
Usage
get_pcoicop(
...,
token = NULL,
version = NULL,
level = NULL,
harmonize = TRUE,
minimal = TRUE,
cols = NULL
)
Arguments
... |
See |
token |
Character. API access token. |
version |
Character. Version of the PCOICOP to retrieve. Default is |
level |
Character. Level of detail to retrieve. Options are |
harmonize |
Logical. If |
minimal |
Logical. If |
cols |
Optional. Character vector of additional columns to include when |
Value
A tibble containing the requested PCOICOP data.
References
https://psa.gov.ph/classification/pcoicop
Examples
## Not run:
get_pcoicop(token = "your_api_token")
## End(Not run)
# If token is not provided, the function will fetch from local cache or
# download the latest version from remote repo
pcoicop <- get_pcoicop()
# Get specific level
pcoicop_filtered <- get_pcoicop(level = "divisions")
pcoicop_filtered
Philippine Central Product Classification (PCPC)
Description
Philippine Central Product Classification (PCPC)
Usage
get_pcpc(
...,
token = NULL,
version = NULL,
level = NULL,
harmonize = TRUE,
minimal = TRUE,
cols = NULL
)
Arguments
... |
See |
token |
Character. API access token. |
version |
Character. Version of the PCPC to retrieve. Default is |
level |
Character. Level of detail to retrieve. Options are |
harmonize |
Logical. If |
minimal |
Logical. If |
cols |
Optional. Character vector of additional columns to include when |
Value
A tibble containing the requested PCPC data.
References
https://psa.gov.ph/classification/pcpc
Examples
## Not run:
get_pcpc(token = "your_api_token")
## End(Not run)
# If token is not provided, the function will fetch from local cache or
# download the latest version from remote repo
pcpc <- get_pcpc()
# Get specific level
pcpc_filtered <- get_pcpc(level = "sections")
pcpc_filtered
Philippine Standard Classification of Education (PSCED)
Description
Philippine Standard Classification of Education (PSCED)
Usage
get_psced(
...,
token = NULL,
version = NULL,
level = NULL,
harmonize = TRUE,
minimal = TRUE,
cols = NULL
)
Arguments
... |
See |
token |
Character. API access token. |
version |
Character. Version of the PSCED dataset. Default is |
level |
Character. Classification levels such as |
harmonize |
Logical. If |
minimal |
Logical. If |
cols |
Optional. Character vector of additional columns to include when |
Value
A data frame of PSCED classifications.
References
https://psa.gov.ph/classification/psced
Examples
## Not run:
get_psced(token = "your_api_token")
## End(Not run)
# If token is not provided, the function will fetch from local cache or
# download the latest version from remote repo
psced <- get_psced()
# Get specific level
psced_filtered <- get_psced(level = "levels")
psced_filtered
Philippine Standard Geographic Code (PSGC)
Description
Philippine Standard Geographic Code (PSGC)
Usage
get_psgc(
...,
token = NULL,
version = NULL,
level = NULL,
harmonize = TRUE,
minimal = TRUE,
cols = NULL
)
Arguments
... |
See |
token |
Character. API access token. If |
version |
Character. PSGC version such as: |
level |
Character. Level of geographic data to retrieve. Available options are: |
harmonize |
Logical. If |
minimal |
Logical. If |
cols |
Optional. Character vector of additional columns to include when |
Value
A data frame of PSGC geographic data.
References
https://psa.gov.ph/classification/psgc
Examples
## Not run:
get_psgc(token = "your_api_token")
## End(Not run)
# If token is not provided, the function will fetch from local cache or
# download the latest version from remote repo
psgc <- get_psgc()
# Get specific level
psgc_regions <- get_psgc(level = "regions")
psgc_regions
Philippine Standard Industrial Classification (PSIC)
Description
Philippine Standard Industrial Classification (PSIC)
Usage
get_psic(
...,
token = NULL,
version = NULL,
level = NULL,
harmonize = TRUE,
minimal = TRUE,
cols = NULL
)
Arguments
... |
See |
token |
Character. API access token. |
version |
Character. Version of the PSIC dataset. Default is |
level |
Character. Classification level such as |
harmonize |
Logical. If |
minimal |
Logical. If |
cols |
Optional. Character vector of additional columns to include when |
Value
A data frame of PSIC classifications.
References
https://psa.gov.ph/classification/psic
Examples
## Not run:
get_psic(token = "your_api_token")
## End(Not run)
# If token is not provided, the function will fetch from local cache or
# download the latest version from remote repo
psic <- get_psic()
# Get specific level
psic_filtered <- get_psic(level = "sections")
psic_filtered
Philippine Standard Occupational Classification (PSOC)
Description
Philippine Standard Occupational Classification (PSOC)
Usage
get_psoc(
...,
token = NULL,
version = NULL,
level = NULL,
harmonize = TRUE,
minimal = TRUE,
cols = NULL
)
Arguments
... |
See |
token |
Character. API access token. |
version |
Character. Version of the PSOC dataset. Default is |
level |
Character. Classification level such as |
harmonize |
Logical. If |
minimal |
Logical. If |
cols |
Optional. Character vector of additional columns to include when |
Value
A data frame of PSOC classifications.
References
https://psa.gov.ph/classification/psoc
Examples
## Not run:
get_psoc(token = "your_api_token")
## End(Not run)
# If token is not provided, the function will fetch from local cache or
# download the latest version from remote repo
psoc <- get_psoc()
# Get specific level
psoc_filtered <- get_psoc(level = "major")
psoc_filtered
Shorten region name
Description
This function shortens the region names in a PSGC data frame.
Usage
shorten_region_name(data, which = c("label", "number"), col = "area_name")
Arguments
data |
A data frame containing PSGC data. |
which |
Character. Specifies whether to shorten the region name by label or number. Options are |
col |
Character. The name of the column containing the area names. Default is |
Value
A data frame with the region names shortened based on the specified which argument.
Examples
regions <- get_psgc(level = "regions")
shorten_region_name(regions)
shorten_region_name(regions, which = "number")