39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
---
|
|
title: "Untitled"
|
|
author: "Matt"
|
|
date: "April 7, 2016"
|
|
output: html_document
|
|
---
|
|
|
|
```{r setup, include=FALSE}
|
|
knitr::opts_chunk$set(echo = TRUE)
|
|
```
|
|
|
|
Should use this document for actual operations and keep actual functions in another document for the public [GitHub repo](https://github.com/mattbk/ledgerr). Shiny will be set up at https://www.shinyapps.io/admin/#/dashboard.
|
|
|
|
```{r}
|
|
# Use https://github.com/maxconway/gsheet
|
|
library(gsheet)
|
|
|
|
# Pull Google sheet locations from another file (journal1, journal2, etc.)
|
|
source("config.R")
|
|
|
|
# Combine bank accounts
|
|
journal<-rbind(journal1,journal2)
|
|
|
|
## Clean up
|
|
# Date is date
|
|
journal$Date<-as.Date(journal$Date,format="%m/%d/%Y")
|
|
# Debit and Credit are numeric, without commas
|
|
journal$Debit<-as.numeric(sub(",","",journal$Debit))
|
|
journal$Credit<-as.numeric(sub(",","",journal$Credit))
|
|
|
|
# Start thinking about reports
|
|
# All time net, should be function
|
|
net<-sum(journal$Credit,na.rm=T)-sum(journal$Debit,na.rm=T)
|
|
|
|
# Net by class and date range, should be function
|
|
|
|
# See other reports in QB and Ledger
|
|
|
|
``` |