BABY NAMES DATA ANALYSIS

POPULARITY OF NAMES THEN AND NOW
1

TIDYVERSE

EASY

last hacked on Jan 04, 2019

Install packages

install.packages("dplyr")
install.packages("ggplot2")

Load packages

library(dplyr)
library(readr)
library(ggplot2)

Set working directory

setwd("/home/computer/myProjects/noob-tidyverse")

Assign df to csv

df <- read_csv("baby-names.csv")

Name Jessica from 1950 to 2008

jessica_df <- filter(df, name == "Jessica", sex == "girl", year > 1950)

ggplot(data = jessica_df) +
  geom_line(mapping = aes(x = percent, y = year))

Name David from 1950 to 2008

david_df <- filter(df, name == "David", sex == "boy", year > 1950)

ggplot(data = jessica_df) +
  geom_line(mapping = aes(x = percent, y = year))

Let's compare popularity of names Susan, David and Robert

n_df <- filter(df, name %in% c("Susan", "David", "Robert"), percent > 0.005)

ggplot(data = n_df) +
  geom_line(mapping = aes(x = year, y = percent, group = name, color = name))


COMMENTS


hi can you share the source code on deepthi.kalal@gmail.com





keep exploring!

back to all projects