commit 5d463cd0683b2c5f470e2249b79ca1cf3a21a0c3 Author: Matt Date: Fri Apr 8 08:42:12 2016 -0500 initialize diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11d2adf --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.RData +.Rhistory +.Rproj.user +config.R \ No newline at end of file diff --git a/config.template.R b/config.template.R new file mode 100644 index 0000000..64e25b7 --- /dev/null +++ b/config.template.R @@ -0,0 +1,3 @@ +# Copy each of the sheets by URL (from address bar) +journal1<-gsheet2tbl("https://docs.google.com/spreadsheets/morestuffhere1") +journal2<-gsheet2tbl("https://docs.google.com/spreadsheets/morestuffhere2") \ No newline at end of file diff --git a/ledgerr.Rproj b/ledgerr.Rproj new file mode 100644 index 0000000..d063e8b --- /dev/null +++ b/ledgerr.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: knitr +LaTeX: pdfLaTeX diff --git a/working.Rmd b/working.Rmd new file mode 100644 index 0000000..475c4a1 --- /dev/null +++ b/working.Rmd @@ -0,0 +1,39 @@ +--- +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 + +``` \ No newline at end of file