Git Product home page Git Product logo

r-stuffs's Introduction

Power Data Analysis

This project involves analyzing power data from a CSV file and generating graphs using ggplot2 in R.

Table of Contents

Introduction

The purpose of this project is to read power data from a CSV file, perform data manipulation and analysis, and generate graphs to visualize the data. The code has been refactored to improve readability, efficiency, and maintainability.

Prerequisites

To run this project, you need to have the following software installed:

  • R (version 3.6 or higher)
  • R packages: ggplot2, lubridate, dplyr

Installation

  1. Clone the repository or download the code files.

  2. Open R or RStudio.

  3. Install the required packages by running the following commands in the R console:

    install.packages("ggplot2")
    install.packages("lubridate")
    install.packages("dplyr")
    
  4. Update the file path in the code to point to your CSV file.

Usage

  1. Run the code in R or RStudio.

  2. You will be prompted with options to view graphs and perform calculations:

    • Enter 1 to see a graph of Power vs. Device in a specific month.
    • Enter 2 to see the minimum power value in the dataset.
    • Enter 3 to see the maximum power value in the dataset.
    • Enter 0 to exit the program.
  3. Follow the prompts to input the Device ID and the month (August or September) for graph visualization.

  4. The graphs will be displayed using ggplot2, and the minimum/maximum power values will be printed to the console.

  5. Repeat the steps to view different graphs or calculations.

File Structure

  1. The project files are organized as follows:

    • power_analysis.R: The refactored R code for data analysis and graph generation.

    • activepowertotal.csv: The input CSV file containing power data. (Available here https://bit.ly/R-adamkeidz)

    • README.md: This README file.


r-stuffs's People

Contributors

adamkeidz 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.