Project Part 1

Preparing the data for time spend

1. Expanation

I use this data because I want to know how people spend their time across many different countries. I want to know how different gender spend their time, how age affect daily activity,and how many hour do they spend working.

2. URL to address data

This is the link to where I find the data and link is the csv format of the data source.

3. Packages

4. Preparation

Read data

times <- read_csv(here::here("_posts/2022-05-10-project-part-1/TIME_USE_1005.csv"))

View data with glimpse

glimpse(times)
Rows: 494
Columns: 13
$ LOCATION     <chr> "AUS", "AUS", "AUS", "AUT", "AUT", "AUT", "BEL"…
$ Country      <chr> "Australia", "Australia", "Australia", "Austria…
$ DESC         <chr> "UPW", "UPW", "UPW", "UPW", "UPW", "UPW", "UPW"…
$ Description  <chr> "Unpaid work", "Unpaid work", "Unpaid work", "U…
$ SEX          <chr> "TOTAL", "WOMEN", "MEN", "TOTAL", "WOMEN", "MEN…
$ Sex          <chr> "Total", "Women", "Men", "Total", "Women", "Men…
$ AGE          <chr> "15_64", "15_64", "15_64", "15_64", "15_64", "1…
$ Age          <chr> "15-64", "15-64", "15-64", "15-64", "15-64", "1…
$ T            <chr> "LY", "LY", "LY", "LY", "LY", "LY", "LY", "LY",…
$ Time         <chr> "Latest year", "Latest year", "Latest year", "L…
$ Value        <dbl> 243.1689, 311.0000, 171.5958, 202.0000, 269.172…
$ `Flag Codes` <chr> "D", "D", "D", NA, NA, NA, NA, NA, NA, NA, NA, …
$ Flags        <chr> "Difference in methodology", "Difference in met…

Change name from Sex to gender and select columns needed for analysis

times2 <- times %>%
  rename(Gender = SEX) %>%
  select(LOCATION, Country, DESC, Description, Gender, Age, T, Time , Value, `Flag Codes`, Flags)

Reviewing time2

glimpse(times2)
Rows: 494
Columns: 11
$ LOCATION     <chr> "AUS", "AUS", "AUS", "AUT", "AUT", "AUT", "BEL"…
$ Country      <chr> "Australia", "Australia", "Australia", "Austria…
$ DESC         <chr> "UPW", "UPW", "UPW", "UPW", "UPW", "UPW", "UPW"…
$ Description  <chr> "Unpaid work", "Unpaid work", "Unpaid work", "U…
$ Gender       <chr> "TOTAL", "WOMEN", "MEN", "TOTAL", "WOMEN", "MEN…
$ Age          <chr> "15-64", "15-64", "15-64", "15-64", "15-64", "1…
$ T            <chr> "LY", "LY", "LY", "LY", "LY", "LY", "LY", "LY",…
$ Time         <chr> "Latest year", "Latest year", "Latest year", "L…
$ Value        <dbl> 243.1689, 311.0000, 171.5958, 202.0000, 269.172…
$ `Flag Codes` <chr> "D", "D", "D", NA, NA, NA, NA, NA, NA, NA, NA, …
$ Flags        <chr> "Difference in methodology", "Difference in met…

5. Add pictures:

times

6. Write the data to file

write_csv(times2, file = "times_use2.csv")