# This is all copied from the "Import Data" dialog.cows <-read_delim("input_data/cattle-NamesFemaleCalves.csv", delim =";", escape_double =FALSE, trim_ws =TRUE, skip =1)
## Rows: 592 Columns: 5
## ── Column specification ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
## Delimiter: ";"
## chr (2): Name, OwnerLanguage
## dbl (3): count, Rank, year
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
cows |># I only want these three namesfilter(Name %in%c("Bella", "Fiona", "Tina")) |># This contains separate data for each language,# but I just want the "all" data.filter(OwnerLanguage =="__all__") |># I only want the data for the years before 2023filter(year <2023) |># I only want the columns Name, count, and yearselect(Name, count, year) |># Now we put everything into ggplot!# We add aesthetics (aes) to tell ggplot which columns # to use for x and y, and the colorggplot(aes(x=year, y=count, color=Name)) +# We add a line and pointsgeom_line() +geom_point() +# We add a title and labelslabs(title="The rise of Bella: frequency of cow names 2010-2022",x ="Year",y="Total count" )
## Rows: 89100 Columns: 5
## ── Column specification ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): CANTON, AGE, SEX
## dbl (2): YEAR, OBS_VALUE
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Simplify the births data into just number of births by year. Then join this data with the deaths data. What was the total population change in each canton?