diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index c823b20..6db446f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -27,7 +27,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v1 diff --git a/README.Rrst b/README.Rrst index e2415f7..40ed41a 100644 --- a/README.Rrst +++ b/README.Rrst @@ -13,8 +13,8 @@ knitr::opts_chunk$set(fig.path = "man/figures/README-") :target: https://github.com/trevorld/r-ledger/actions :alt: R-CMD-check -.. image:: https://img.shields.io/codecov/c/github/trevorld/r-ledger/master.svg - :target: https://codecov.io/github/trevorld/r-ledger?branch=master +.. image:: https://codecov.io/github/trevorld/r-ledger/branch/master/graph/badge.svg + :target: https://app.codecov.io/github/trevorld/r-ledger?branch=master :alt: Coverage Status .. image:: https://cranlogs.r-pkg.org/badges/ledger diff --git a/README.rst b/README.rst index 3a1c7a4..d9ca299 100644 --- a/README.rst +++ b/README.rst @@ -11,8 +11,8 @@ ledger :target: https://github.com/trevorld/r-ledger/actions :alt: R-CMD-check -.. image:: https://img.shields.io/codecov/c/github/trevorld/r-ledger/master.svg - :target: https://codecov.io/github/trevorld/r-ledger?branch=master +.. image:: https://codecov.io/github/trevorld/r-ledger/branch/master/graph/badge.svg + :target: https://app.codecov.io/github/trevorld/r-ledger?branch=master :alt: Coverage Status .. image:: https://cranlogs.r-pkg.org/badges/ledger @@ -82,7 +82,7 @@ register Here are some examples of very basic files stored within the package: -.. sourcecode:: r +.. code:: r library("ledger") @@ -109,7 +109,7 @@ Here are some examples of very basic files stored within the package: ## # … with 32 more rows -.. sourcecode:: r +.. code:: r hledger_file <- system.file("extdata", "example.hledger", package = "ledger") @@ -134,7 +134,7 @@ Here are some examples of very basic files stored within the package: ## # … with 32 more rows -.. sourcecode:: r +.. code:: r beancount_file <- system.file("extdata", "example.beancount", package = "ledger") @@ -163,7 +163,7 @@ Here are some examples of very basic files stored within the package: Here is an example reading in a beancount file generated by ``bean-example``: -.. sourcecode:: r +.. code:: r bean_example_file <- tempfile(fileext = ".beancount") @@ -191,7 +191,7 @@ Here is an example reading in a beancount file generated by ``bean-example``: ## # … with 3,320 more rows -.. sourcecode:: r +.. code:: r suppressPackageStartupMessages(library("dplyr")) @@ -228,7 +228,7 @@ Using rio::import and rio::convert If one has loaded in the ``ledger`` package one can also use ``rio::import`` to read in the register: -.. sourcecode:: r +.. code:: r df2 <- rio::import(bean_example_file) @@ -254,7 +254,7 @@ net_worth Some examples of using the ``net_worth`` function using the example files from the ``register`` examples: -.. sourcecode:: r +.. code:: r dates <- seq(as.Date("2016-01-01"), as.Date("2018-01-01"), by="years") @@ -271,7 +271,7 @@ Some examples of using the ``net_worth`` function using the example files from t ## 3 2018-01-01 USD 6743. 6264 -521. 1000 -.. sourcecode:: r +.. code:: r net_worth(hledger_file, dates) @@ -287,7 +287,7 @@ Some examples of using the ``net_worth`` function using the example files from t ## 3 2018-01-01 USD 6743. 7264 -521. -.. sourcecode:: r +.. code:: r net_worth(beancount_file, dates) @@ -303,7 +303,7 @@ Some examples of using the ``net_worth`` function using the example files from t ## 3 2018-01-01 USD 6743. 7264 -521. -.. sourcecode:: r +.. code:: r net_worth(bean_example_file, dates) @@ -322,7 +322,7 @@ prune_coa Some examples using the ``prune_coa`` function to simplify the "Chart of Account" names to a given maximum depth: -.. sourcecode:: r +.. code:: r suppressPackageStartupMessages(library("dplyr")) @@ -350,7 +350,7 @@ Some examples using the ``prune_coa`` function to simplify the "Chart of Account ## 11 Liabilities USD -2248. -.. sourcecode:: r +.. code:: r df %>% prune_coa(2) %>% @@ -393,7 +393,7 @@ beancount example generated by ``bean-example``. First we load the (mainly tidyverse) libraries we'll be using and adjusting terminal output: -.. sourcecode:: r +.. code:: r options(width=240) # tibble output looks better in wide terminal output @@ -414,7 +414,7 @@ First we load the (mainly tidyverse) libraries we'll be using and adjusting term Then we'll write some convenience functions we'll use over and over again: -.. sourcecode:: r +.. code:: r print_tibble_rows <- function(df) { @@ -440,7 +440,7 @@ Basic balance sheets Here is some basic balance sheets (using the market value of our assets): -.. sourcecode:: r +.. code:: r print_balance_sheet <- function(df) { @@ -464,7 +464,7 @@ Here is some basic balance sheets (using the market value of our assets): ## 3 2021-11-12 VACHR 15 15 0 -.. sourcecode:: r +.. code:: r print_balance_sheet(prune_coa(df, 2)) @@ -482,7 +482,7 @@ Here is some basic balance sheets (using the market value of our assets): ## 1 Liabilities:US USD -2421. -.. sourcecode:: r +.. code:: r print_balance_sheet(df) @@ -509,7 +509,7 @@ Basic net worth chart Here is a basic chart of one's net worth from the beginning of the plaintext accounting file to today by month: -.. sourcecode:: r +.. code:: r next_month <- function(date) { @@ -529,7 +529,7 @@ Basic income sheets ~~~~~~~~~~~~~~~~~~~ -.. sourcecode:: r +.. code:: r month_cutoff <- zoo::as.yearmon(Sys.Date()) - 2/12 @@ -583,7 +583,7 @@ Basic income sheets ## 3 USD net 2028. 1826. 2413. -.. sourcecode:: r +.. code:: r print_income(prune_coa(df, 2)) @@ -597,7 +597,7 @@ Basic income sheets ## 1 Income:US USD 9437. 9279. 4640. -.. sourcecode:: r +.. code:: r print_expenses(prune_coa(df, 2)) @@ -616,7 +616,7 @@ Basic income sheets ## 6 Expenses:Transport USD 120 120 0 -.. sourcecode:: r +.. code:: r print_income(df) @@ -632,7 +632,7 @@ Basic income sheets ## 3 Income:US:Hoogle:Salary USD 9231. 9231. 4615. -.. sourcecode:: r +.. code:: r print_expenses(df) @@ -668,7 +668,7 @@ Basic income sheets And here is a plot of income, expenses, and net income over time: -.. sourcecode:: r +.. code:: r ggplot(compute_total(df), aes(x=yearmon, y=amount, group=commodity, colour=commodity)) +