Giter VIP home page Giter VIP logo

ezrplots's Introduction

EZRplots

A package that provides shortcuts for making elegant plots

Installation

You can install the the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("shanealman/EZRplots")
library(EZRplots)

leafletPlot

The first function will create a chloropleth map for the user. The user will input the data set they wish to use for the map, which will have 2 columns: the names of their designated region and the variable of interest. The user will then specify which map they wish to display: whether it is all the countries, the states, global regions, etc. The user will have the option to specify additional parameters stating the units of their variable, how many bins for the legend they wish to create, etc. The function will return the resulting cloropleth map altered to the users' desires.

Example with data set Country_Data, with columns Country_Name and Percent:

leafletPlot(data_set = Country_Data, col_name = "Country_Name", col_variable = "Percent", type_of_map = "countries", bins_of_map = (0:5*.2), col_variable_unit = "%", title = "Choropleth Map of Country Data")

Example with data set US_States_Data, with columns State_Name and Votes:

leafletPlot(data_set = US_States_Data, col_name = "State_Name", col_variable = "Votes", type_of_map = "us_states", bins_of_map = (0:5*2), col_variable_unit = "votes", title = "Choropleth Map of State Votes")

easy_plot_ly

This is a shortcut function to help generate 2D or 3D plots with plot_ly. The user will input their data and the variables they want for the x, y, and z axes. The user will be able to specify the type of plot they want to generate from several basic options like scatter, line, surface, 3d_density, mesh, or an autogenerated plot. Addtional helper functions are available to add a 3D regression plane and to change the plot aesthetics.

ez_scatter

This is a function that can produce a variety of scatterplots from ggplot2 depending on the inputs that the user chooses to include in the function. Users may input different datasets, variables, colors, and shapes to customize their graphs. For variable names and colorscusers will need to input their arguments as stings to allow ggplot to work properly within the function. It is also important to note that functions with only two variables should have colors inputed corresponding to those in ggplot2 and the shape argument should be a number corressponding to the point shapes that ggplot2 provides. For functions with three variables you may enter colors from RColorBrewer and the shape argument must be a string of the categorical varibles.

Example with two variables.

ez_scatter(data = iris, x_num = "Petal.Width", y_num = "Petal.Length", color = "steelblue", shape = 3)

Example with three variables.

ez_scatter(data = iris, x_num = "Petal.Width", y_num = "Petal.Length", z_cat = "Species", color = "Spectral", shape = "Species")

ez_labels

This function can be added to an existing scatterplot in order to add a title to the plot, add axis labels, and customize the colors and typography of those labels.

plot <- ez_scatter(data = iris, x_num = "Petal.Width", y_num = "Petal.Length", z_cat = "Species", color = "Blues", shape = "Species")

ez_labels(plot = plot, title = "Petal Width vs Petal Length", x = "Petal Width", y = "Petal Length", title_color = "green", axis_color = "orange", title_type = "bold.italic", axis_type = "bold")

ezrplots's People

Contributors

agreen29 avatar asarango1 avatar shanealman avatar adharlow avatar kbodwin avatar

Watchers

 avatar

ezrplots's Issues

Issue about title and axes

One issue I am concerned about this package is how we are going to be able to implement effective titles and axis labels in the plot if the function is unaware of what the data set or user is trying to convey. Maybe we could also make additional parameters in our functions specifying what they wish the title and labels to be? Another issue I am a little concerned about is how are we going to able to decide if a key or axis labels are necessary to the plot when trying to make these data visualizations.

Can't get easy_plot_ly() to work

image

I'm not sure if I'm inputting the data in correctly, but I keep getting the same error every time I try and run it. Both variables have been changed to numeric. A more detailed description on how to input the variables would be appreciated

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.