-
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.
Merge pull request #20 from davidycliao/v0.1.6
UPDATE v0.1.6
- Loading branch information
Showing
13 changed files
with
140 additions
and
103 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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,8 +1,42 @@ | ||
### Package Utility Functions | ||
#' On package attach, display a startup message to the user. | ||
#' On package attach, display a startup message | ||
#' | ||
#' @keywords internal | ||
.onAttach <- function(...) { | ||
packageStartupMessage("## legisTaiwan ##") | ||
packageStartupMessage("## An R package connecting to the Taiwan Legislative API. ##") | ||
# ANSI color codes | ||
dark_green <- "\033[38;5;22m" # Deep Green color | ||
red <- "\033[31m" | ||
orange <- "\033[38;5;214m" | ||
yellow <- "\033[33m" | ||
green <- "\033[32m" | ||
blue <- "\033[34m" | ||
indigo <- "\033[38;5;54m" | ||
violet <- "\033[35m" | ||
reset <- "\033[0m" | ||
|
||
# Coloring Taiwan in rainbow colors | ||
rainbow_taiwan <- paste0( | ||
red, "T", | ||
orange, "a", | ||
yellow, "i", | ||
green, "w", | ||
blue, "a", | ||
indigo, "n", | ||
reset | ||
) | ||
|
||
# Creating the first message | ||
message1 <- paste0(dark_green, "legis", reset, rainbow_taiwan) | ||
|
||
# Maximum allowed length | ||
max_len <- 64 | ||
num_spaces <- max_len - nchar(message1, type = "bytes") - 4 | ||
num_spaces <- max(0, num_spaces) | ||
|
||
message1 <- paste0("## ", message1, rep(" ", num_spaces), " ##") | ||
|
||
# Second message | ||
message2 <- "## An R package connecting to the Taiwan Legislative API. ##" | ||
|
||
packageStartupMessage(message1) | ||
packageStartupMessage(message2) | ||
} |
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
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
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
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,60 @@ | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
# Real-time and Archives of Taiwan Legislative Data in R <img src="../man/figures/logo.png" align="right" width="180"/> | ||
|
||
<!-- badges: start --> | ||
|
||
[![R](https://github.com/davidycliao/legisTaiwan/actions/workflows/r.yml/badge.svg)](https://github.com/davidycliao/legisTaiwan/actions/workflows/r.yml) | ||
[![codecov](https://codecov.io/gh/davidycliao/legisTaiwan/branch/master/graph/badge.svg?token=HVVTCOE90D)](https://codecov.io/gh/davidycliao/legisTaiwan) | ||
[![R-CMD-check](https://github.com/davidycliao/legisTaiwan/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/davidycliao/legisTaiwan/actions/workflows/R-CMD-check.yaml) | ||
[![Test | ||
coverage](https://github.com/davidycliao/legisTaiwan/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/davidycliao/legisTaiwan/actions/workflows/test-coverage.yaml) | ||
[![pkgdown](https://github.com/davidycliao/legisTaiwan/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/davidycliao/legisTaiwan/actions/workflows/pkgdown.yaml) | ||
[![CodeFactor](https://www.codefactor.io/repository/github/davidycliao/legistaiwan/badge)](https://www.codefactor.io/repository/github/davidycliao/legistaiwan) | ||
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7633962.svg)](https://doi.org/10.5281/zenodo.7633962) | ||
<!-- badges: end --> | ||
|
||
<div style="text-align: justify"> | ||
|
||
`legisTaiwan` is designed to download the real-time archives of Taiwan | ||
legislative data easily. This package includes many streamlined | ||
functions to access [Taiwan Legislative Yuan | ||
API](https://data.ly.gov.tw/index.action) in R without any hassle or | ||
runarounds. | ||
|
||
</div> | ||
|
||
<br> | ||
|
||
## Get Started with Using [`remotes`](https://github.com/r-lib/remotes): | ||
|
||
``` r | ||
install.packages("remotes") | ||
remotes::install_github("davidycliao/legisTaiwan", force = TRUE) | ||
``` | ||
|
||
``` r | ||
library(legisTaiwan) | ||
#> ## legisTaiwan ## | ||
#> ## An R package connecting to the Taiwan Legislative API. ## | ||
``` | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<br> | ||
|
||
## Caution: | ||
|
||
<div style="text-align: justify"> | ||
|
||
`legisTaiwan` requires a stable internet connection to retrieve data | ||
from the API. While most functions can fetch data spanning a long | ||
period, they tend to be bandwidth-intensive due to the size of the | ||
datasets. If you plan to download data over an extended period, I | ||
recommend using get_variable_info() first to verify the current file | ||
sizes on the API manual. Also, consider writing a batch retrieval | ||
process with appropriate handlers to track the progress of file input, | ||
ensuring the completeness of the requested data. | ||
|
||
</div> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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