BigDataBERTA-NUNES/.Rhistory

507 lines
21 KiB
Text

#
r2 = which(r1 == TRUE)
#
vowels = c('a','e','i','o','u','y')
alphabet = letters
r1 = letters %in% vowels
#Le result est un vecteur de boolean
#avec true quand les deux elements sont
#egaux, et false quand c l'inverse
v1 = seq(6)
#
#r2 = which(r1 == TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
?which
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
?letters
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
?which
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
?strsplit
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
myname_split[0]
myname_split[1]
myname_split[1][0]
myname_split[2
myname_split[2]
myname_split[2].[0]
myname_split[1].[0]
myname_split[[1]][0]
myname_split[[1]][1]
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
print(r6)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP1_2.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
rep(c(0,1),13)
c(1,26,1)
seq(1,26,1)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
install.packages("ggplot2")
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
head
msleep
head?
s
?head
head(msleep)
?names
?head
head(letters)
letters
head(letters, n = 7)
head(msleep, n=2)
?str
str(1:12)
str(freeny)
str(msleep)
?summary
sumamry(letters)
summary(letters)
summary(msleep)
msleep
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
msleep
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
msleep
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
msleep
msleep
?na.omit
msleep
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
summary("pauline")
summary('p','a','u')
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
summary(strsplit(Pauline, NULL))
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
summary(strsplit("Pauline", NULL))
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
summary(strsplit("Pauline", NULL))
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
View(p600)
p600[[1]][1]
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
letters %in% p600
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', encoding = 'ASCII', echo=TRUE)
?substr
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
msleep
which(msleep[[1]] ==Cow)
which(msleep[[1]] =="Cow")
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
msleep
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
which( msleep[[1]] == "w")
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
p777 <- which( msleep[[1]] == "w")
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
install.packages("rapportools")
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
source('C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/TP2_1.R', echo=TRUE)
n
n
n
n
library(tidyverse)
library(ggplot2)
setwd("C:/Users/nunes/OneDrive/Bureau/WorkDay/INSA/Big_Data/Projet")
##########################
#Acquisition of the data #
##########################
#Variable containing all the information
tab <- read.table("yob1880.txt",h=FALSE,sep=",")
Year <- matrix(1880,ncol=1,nrow = nrow(tab))
tab <- cbind(Year,tab)
for (i in seq(1881,2019,1)){
#Dynamic name for the source txt file
namesource <- "yob"
namesource <- paste(c(namesource,i),collapse = "")
namesource <- paste (c(namesource,".txt"), collapse="")
# Table used inside the for loop to extrat the informations
tabinter <- read.table(namesource,h=FALSE,sep=",")
#Converting the table into the format "Year,Name,Sex,Number"
Year <- matrix(i,ncol=1,nrow = nrow(tabinter))
tabinter <- cbind(Year,tabinter)
#Adding the new informations to the final table
tab <- rbind(tab,tabinter)
}
final_table <- tab%>%
rename(
Name = V1,
Sex = V2,
Number = V3
)
####################################################################
# Partie 1 - L'influence de Marylin depuis 1880 #
####################################################################
MarilynFemme <- final_table %>%
filter(Name == "Marilyn")%>%
group_by(Year,Number)%>%
filter(Sex=='F')
MarilynHomme <- final_table %>%
filter(Name == "Marilyn")%>%
group_by(Year,Number)%>%
filter(Sex=='M')
ggplot(MarilynFemme,aes(x=Year,y=Number, fill=Number))+
geom_bar(stat = "identity")+
ggtitle("Evolution des naissances avec le prénom Marilyn depuis 1880, femmes")
ggplot(MarilynHomme,aes(x=Year,y=Number, fill=Number))+
geom_bar(stat = "identity")+
ggtitle("Evolution des naissances avec le prénom Marilyn depuis 1880, hommes")
AdolphHomme <- final_table %>%
filter(Name == "Adolph")%>%
group_by(Year,Number)%>%
filter(Sex=='M')
ggplot(AdolphHomme,aes(x=Year,y=Number, fill=Number))+
geom_bar(stat = "identity")+
ggtitle("Evolution des naissances avec le prénom Adolph depuis 1880, hommes")
##################################
# 1.1 - Number of births by year #
##################################
NaissancesAnDepuis1880 <- final_table %>%
group_by(Year)%>%
summarise(
NbrBirths = sum(Number)
)
ggplot(NaissancesAnDepuis1880,aes(x=Year,y=NbrBirths, color= NbrBirths))+
geom_line(size = 3)+
ggtitle("Nombre de naissances par année depuis 1880, sexes confondus")
NaissancesAn6090 <- final_table %>%
group_by(Year,Sex)%>%
filter(Year < 1990)%>%
filter(Year> 1960)%>%
summarise(NbrBirths = sum(Number))
ggplot(NaissancesAn6090,aes(x=Year,y=NbrBirths, color = Sex))+
geom_line(size=5)+
geom_point()+
ggtitle("Nombre de naissances par année, entre 1960 et 1990")+
NaissancesSexeSep <- final_table %>%
group_by(Year,Sex)%>%
summarise(NbrBirths = sum(Number))
ggplot(NaissancesSexeSep,aes(x=Year,y=NbrBirths, color = Sex))+
geom_line(size=5)+
geom_point()+
ggtitle("Nombre de naissances par année, sexe séparés")
NaissancesSexeSep <- final_table %>%
group_by(Year,Sex)%>%
summarise(NbrBirths = sum(Number))
ggplot(NaissancesSexeSep,aes(x=Year,y=NbrBirths, color = Sex))+
geom_line(size=5)+
geom_point()+
ggtitle("Nombre de naissances par année, sexe séparés")
PrenomsHommeDepuis1880 <- final_table %>%
group_by(Name)%>%
filter(Sex == "M")%>%
summarise(
NumberOfBirths = sum(Number)
)%>%
arrange(desc(NumberOfBirths))%>%
top_n(5)
ggplot(PrenomsHommeDepuis1880,aes(x=Name,y=NumberOfBirths))+
geom_bar(stat = "identity")+
ggtitle("Most given male names since 1880")
# Create Data
PrenomsHommeDepuis1880 <- data.frame(
name=c('James','John','Robert','Michael','William','Others'),
value= c(2.89,2.86,2.70,2.44,2.34,86.77)
)
# Basic piechart
ggplot(data, aes(x="", y=value, fill=name)) +
geom_bar(stat="identity", width=1) +
coord_polar("y", start=0)+
theme_void()
# Create Data
PrenomsHommeDepuis1880 <- data.frame(
name=c('James','John','Robert','Michael','William','Others'),
value= c(2.89,2.86,2.70,2.44,2.34,86.77)
)
# Basic piechart
ggplot(data, aes(x="", y=value, fill=name)) +
geom_bar(stat="identity", width=1) +
coord_polar("y", start=0)+
theme_void()
# Create Data
PrenomsHommeDepuis1880 <- data.frame(
name=c('James','John','Robert','Michael','William','Others'),
value= c(2.89,2.86,2.70,2.44,2.34,86.77)
)
# Basic piechart
ggplot(PrenomsHommeDepuis1880, aes(x="", y=value, fill=name)) +
geom_bar(stat="identity", width=1) +
coord_polar("y", start=0)+
theme_void()
PrenomsFemmesDepuis1880 <- final_table %>%
group_by(Name)%>%
filter(Sex == "F")%>%
summarise(
NumberOfBirths = sum(Number)
)%>%
arrange(desc(NumberOfBirths))%>%
top_n(5)
ggplot(PrenomsFemmesDepuis1880,aes(x=Name,y=NumberOfBirths))+
geom_bar(stat = "identity")+
ggtitle("Most given female names since 1880")
name= c('Mary','Elizabeth','Patricia','Jennifer','Linda','Others')
value= c(2.35,0.94,0.89,0.84,0.83,94.15)
# Create Data
PrenonesFemmes1880 <- data.frame(name,value)
# Basic piechart
ggplot(PrenonesFemmes1880, aes(x="", y=value, fill=name)) +
geom_bar(stat="identity", width=1) +
coord_polar("y", start=0)+
theme_void()
PrenomsHommeDepuis2000 <- final_table %>%
group_by(Name)%>%
filter(Sex == "M")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)%>%
arrange(desc(NumberOfBirths))%>%
top_n(5)
ggplot(PrenomsHommeDepuis2000,aes(x=Name,y=NumberOfBirths))+
geom_bar(stat = "identity")+
ggtitle("Most given male names since 2000")
NbrMaleBirths2000 <- final_table %>%
group_by(Sex)%>%
filter(Sex == "M")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)
top5MaleNames2000 <- tab233%>% summarise(
N=sum(NumberOfBirths)
)
OtherNames2000 <- (NbrMaleBirths2000[2] - (top5MaleNames2000[1]))
# Create Data
PrenomsHomme2000 <- data.frame(
name=c('Jacob','Michael','Ethan','William','Mathew','Others'),
value= c(402290,363299,335423,333255,317778,OtherNames2000)
)
# Basic piechart
ggplot(PrenomsHomme2000, aes(x="", y=value, fill=name)) +
geom_bar(stat="identity", width=1) +
coord_polar("y", start=0)+
theme_void()
NbrMaleBirths2000 <- final_table %>%
group_by(Sex)%>%
filter(Sex == "M")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)
top5MaleNames2000 <- tab233%>% summarise(
N=sum(NumberOfBirths)
)
OtherMaleNames2000 <- (NbrMaleBirths2000[2] - (top5MaleNames2000[1]))
# Create Data
PrenomsHomme2000 <- data.frame(
name=c('Jacob','Michael','Ethan','William','Mathew','Others'),
value= c(402290,363299,335423,333255,317778,OtherMaleNames2000)
)
NbrMaleBirths2000 <- final_table %>%
group_by(Sex)%>%
filter(Sex == "M")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)
top5MaleNames2000 <- tab233%>% summarise(
N=sum(NumberOfBirths)
)
OtherMaleNames2000 <- (NbrMaleBirths2000[2] - (top5MaleNames2000[1]))
#########
PrenomsHommeDepuis2000 <- final_table %>%
group_by(Name)%>%
filter(Sex == "M")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)%>%
arrange(desc(NumberOfBirths))%>%
top_n(5)
ggplot(PrenomsHommeDepuis2000,aes(x=Name,y=NumberOfBirths))+
geom_bar(stat = "identity")+
ggtitle("Most given male names since 2000")
NbrMaleBirths2000 <- final_table %>%
group_by(Sex)%>%
filter(Sex == "M")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)
top5MaleNames2000 <- PrenomsHommeDepuis2000%>% summarise(
N=sum(NumberOfBirths)
)
OtherMaleNames2000 <- (NbrMaleBirths2000[2] - (top5MaleNames2000[1]))
# Create Data
PrenomsHomme2000 <- data.frame(
name=c('Jacob','Michael','Ethan','William','Mathew','Others'),
value= c(402290,363299,335423,333255,317778,OtherMaleNames2000)
)
# Basic piechart
ggplot(PrenomsHomme2000, aes(x="", y=value, fill=name)) +
geom_bar(stat="identity", width=1) +
coord_polar("y", start=0)+
theme_void()
#########
PrenomsFemmeDepuis2000 <- final_table %>%
group_by(Name)%>%
filter(Sex == "F")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)%>%
arrange(desc(NumberOfBirths))%>%
top_n(5)
ggplot(PrenomsFemmeDepuis2000,aes(x=Name,y=NumberOfBirths))+
geom_bar(stat = "identity")+
ggtitle("Most given female names since 2000")
NbrFemaleBirths2000 <- final_table %>%
group_by(Sex)%>%
filter(Sex == "F")%>%
filter(Year>2000)%>%
summarise(
NumberOfBirths = sum(Number)
)
top5FemaleNames2000 <- PrenomsFemmeDepuis2000%>% summarise(
N=sum(NumberOfBirths)
)
OtherFemaleNames2000 <- (NbrMaleBirths2000[2] - (top5FemaleNames2000[1]))
name= c('Emma','Olivia','Emily','Isabella','Sophia','Others')
value= c(363402,327356,315202,313471,293494,OtherFemaleNames2000)
# Create Data
PrenomsFemme2000 <- data.frame(name,value)
# Basic piechart
ggplot(PrenomsFemme2000, aes(x="", y=value, fill=name)) +
geom_bar(stat="identity", width=1) +
coord_polar("y", start=0)+
theme_void()
EvolutionJames <- final_table %>%
group_by(Year)%>%
filter(Name == "James")%>%
summarise(
NumberOfBirths = sum(Number)
)
ggplot(EvolutionJames,aes(x=Year,y=NumberOfBirths))+
geom_line(size=5)+
geom_point()+
ggtitle("The evolution of the name James since 1880")
# The evolution of the name Mary since 1880 #
##############################################
EvolutionMary <- final_table %>%
group_by(Year)%>%
filter(Name == "Mary")%>%
summarise(
NumberOfBirths = sum(Number)
)
ggplot(EvolutionMary,aes(x=Year,y=NumberOfBirths))+
geom_line(size=5)+
geom_point()+
ggtitle("The evolution of the name Mary since 1880")