Code Monkey home page Code Monkey logo

cci_electricity's Introduction

CCI_electricity

Importing and exploring CCI electricity usage data.

navigating this repo

  • functions.R contains the functions for reading and processing the meter data.

  • meter_metadata.csv is a metadata table which is used to make sure we're reading in the right files, and for matching pairs of meters to their location and the percentage of their usage that should be apportioned to CCI, etc.

  • data_meters is a folder containing the raw meter readings (.xlsx files). These are not tracked by git so are not in the online version of this repo.

  • plots is a folder containing any plots that we save to file (to prevent them cluttering up the main folder).

R scripts and outputs

  • script 1: process meters: this is a first go at using the functions to read in all the meter readings, process them, save the processed data to a file (not tracked by git so not in the online version of this repo).

    • s01_process_meters.Rmd is an R markdown file containing the R code and explanations. Knitting this file produces the associated outputs:
    • s01_process_meters.md shows the outputs of the R script. Click on this file to view the outputs online
    • s01_process_meters/figure-gfm contains the plots used in the .md file above (just ignore this folder)
    • This script also saves a file called processed_meter_data.csv (not on the online GitHub version).
  • script 2: summarise and plot: this contains some code to make summaries and plots.

    • s02_plots.Rmd = the R code and explanations
    • s02_plots.md and s02_plots/figure-gfm = outputs of the R markdown file
    • This script also saves some plots as .png files in the plots folder.

administrative files:

  • .gitignore: this tells git which files not to track. We use this to make sure that the raw data, processed data, and plots are not version-controlled and are not uploaded to GitHub.
  • LICENSE: this file specifies that other people who find this repo on GitHub may re-use the code.
  • README.md: there is a 'readme' file in each folder explaining what the folder is for. These help people to navigate the folders on GitHub.

next steps

  • add more fields to metadata to apportion usage to different CCI orgs
  • use the usage apportioning fields to split out data into usage by organisation / by CCI / total
  • develop more functions for summarising and plotting in useful ways
  • develop a shiny app for displaying the data (need to think about how the data processing would be controlled)

shiny app

ideal situation:

  • have an optional, specific 're-process meter readings' button that causes the data to be read in from a folder of raw meter reading files,the data processing steps to be performed, and a new processed_meter_data.csv file to be produced and saved.
  • then all the plotting and summarising actions can be done on that processed_meter_data.csv dataset. This way the whole processing doesn't have to be re-done every time you want to make some new plots.

caveats:

  • I don't think a shiny app can access a folder of files on your computer (unless it's run on your computer rather than on a separate server e.g. shinyapps.io). So if the app is only ever run on Sophie's computer, it can read in the 39 raw data files from a local folder. However if it's hosted elsewhere, it might be easier to run the data processing locally in an R Markdown file, and upload the latest processed_meter_data.csv file to the shiny app each time you use it.

cci_electricity's People

Contributors

lizziepear avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.