Code Monkey home page Code Monkey logo

r-data-analysis-piechart's Introduction

Data-Analysis-and-Visualization-of-R-events-Aug.2018 --- Aug.2019

all.R: The variable "dat" received all data from the .rds file. Then I created a variable for each month of the year with the same information "dat" but filtered with its date limitation . [for example, 2018 February: filter (.., local_date> = as.Date ("2018-02- 01 ") ... <= .. (" 02/28/2018 ")]

After that, I calculated the number of rows of each "subset". So it was simple: I created a vector with the labels for each month and created another with the calculated number of lines. After that, I put them both on a pie chart.

Same for years.

new_all.R:

The variable "events" received all data from the .rds file. Then I created two new columns, "year" and "year_month", which have the information "% Y" and "% Y-%m" from local_date, respectively. "groupedevents" was created by grouping "events" data by "year" and "year_month" columns. The "dffinal" variable received the summarised "groupedevents" along a count function,n(). "per_year" variable was created from the aggregation of "dffinal$count_events" for each year with the sum function(to add all the count of events from the same year). After all, I just put the results on a pie chart.

r-data-analysis-piechart's People

Contributors

guilherme-marcello 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.