Installing packages for atom on Windows

Hello all,

Today this will be a quick tutorial about installing packages in atom for Windows machines. Atom is an open source code editor that is comprised of over 50 open-source packages. Think of it as if sublime text and notepad++ had a baby and it just turned out to be awesome.

<insert lego awesome image here>

In order to download your version just go to https://atom.io/  Since this is an open source tool you are allowed to customize the Atom code editor to you specific needs. There is a huge open source developer community that has created many packages to increases your coding productivity flow.

So there are two ways to install a package in atom. The first way(which kind of sucks) is to go through the gui.

GUI Way

You can go to the File menu >Settings to open up the settings configuration for Atom.

atom_open

Or Press the buttons ctrl+shift+p (all at the same time) and a search menu appears. In the search menu type the keywords Install packages and click Settings View:Install Packages and Themes

installview

In the search bar type in the name of the package you are looking to download. I don’t like installing package this way because you ending have a list of packages that you are not really looking for.  I like going through the command line to install packages

Command Line Way

Navigate to the windows command learn. By default you are taken to the path C:\WINDOWs\system32

Change the path to


cd c:\users\laptop_name\.atom

next type in

 apm 

in order to activate the Atom Package Manager

You should see something like this:

apm

then type the code


apm install &lt;package-name&gt;

And that’s it! You are done and you have increased your productivity by a 1000!

Resources:

List of packages to install :https://atom.io/packages

Creating your own atom package: https://atom.io/docs/v0.60.0/your-first-package

List of packages that you should install : http://codeforgeek.com/2014/09/5-must-have-packages-atom-editor/

Creating Animated Maps with Tableau

So I have been experimenting with a software package called Tableau for a little bit. For those of you who do not know what Tableau is, it is a software tool that can automate data visualizations. Many businesses use Tableau to create dashboards, maps, etc. It has a hefty price tag but if you are a student you can get a year-long license for free. With Tableau you can upload data from a variety of sources such as Excel, SQL, text files, and so on. Today I will show you how to create an animated map with Tableau.

First you will need to format and clean up your data. The beauty of Tableau is that you do not have to use longitude and latitude as location coordinates. You can simply use the state and city names to map out locations. I also had to change format the start time and end time from general numbers to date format (year start and year end). I also had to use an excel plugin in order to format pre-1900s dates: http://j-walk.com/ss/excel/files/xdate.htm

cleanData

Step 1:Open a new Tableau Workbook

part1

Step 2: Connect to your data. Choose the format of your data from the left hand menu.part2

Step 3:Since I am working with datespart3

Step 4: Double click on the geographic dimension State and a map should appear with markers for each location in your data.part4

part5

Step 5: Since each mark represents different people I dragged the Name dimension to the colors box in the Marks Labels region.part6

Step 7: Drag Year start to Pages. You will notice in your filters box new buttons pop up.part7

Step 8: Click the play button and the animation will start.part8

Resources:

Tableau: http://www.tableausoftware.com/

Best book that I know for Tableau is Communicating Data with Tableau

Long Data Vs. Wide Data

So, lately I have had my hands on some raw unclean data for an assignment for school. Originally I thought that messy data was about cleaning up blank values, formatting text, numbers, and strings in the right form, etc. But as I proceed to analyze my data in R I found out that it could not be handled. There was a key concept that I was missing when it comes to setting up data the right way: Wide and Long Data

What is Wide Data?

In the wide data (also known as unstacked) is when each variable attribute for a subject is in a separate column.

Person Age Weight
Buttercup 24 110
Bubbles 24 105
Blossom 24 107

What is Long Data?

Narrow (stacked) data is presented with one column containing all the values and another column listing the context of the value

Person Variable Value
Buttercup Age 24
Buttercup Weight 110
Bubbles Age 24
Bubbles Weight 105
Blossom Age 24
Blossom Weight 107

It is easier for r to do analysis in the Long data form. This concept might seem weird at first. We are use to seeing and analyzing data in Wide data form but with practice it gets easier over time. R has an awesome package called reshape2 to convert your data from wide to long.

First install the r package and load the library.


install.packages("reshape2")
library(reshape2)

Using the wide table above we will split our variables into two groups identifiers and measured variables.

Identifier variable:Person
Measured variable: Age, weight

In order to transform this wide data into long data we will have to use the melt method. You “melt” data so that each row is a unique id-variable combination.

df
 Person Age Weight
1 Buttercup 24 110
2 Bubbles 24 105
3 Blossom 24 107

ppg <-melt(df,id=c("Person"),measured=c("Age","Weight"))
 ppg
 Person variable value
1 Buttercup Age 24
2 Bubbles Age 24
3 Blossom Age 24
4 Buttercup Weight 110
5 Bubbles Weight 105
6 Blossom Weight 107

For official documentation about the reshape library from its creator Hadley Wickham: http://had.co.nz/reshape/introduction.pdf

More about Wide vs. Long data check out :http://www.theanalysisfactor.com/wide-and-long-data/

More information about cleaning and shaping data from messy data to tidy data check out Hadley Wickham’s paper Tidy Data: http://vita.had.co.nz/papers/tidy-data.pdf