-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
50 lines (50 loc) · 1.82 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
library(haven)
PER_2021a <- read_dta("//sdssrv03.idb.iadb.org/surveys/survey/PER/ENAHO/2021/a/data_merge/PER_2021a.dta")
View(PER_2021a)
library(tidyverse)
PER_2021a <- PER_2021a %>%
group_by(conglome, vivienda, hogar) %>%
mutate(idh_ch = group_indices())
PER_2021a <- PER_2021a %>%
group_by(conglome, vivienda, hogar) %>%
rowwise() %>%
mutate(idh_ch = group_indices()) %>%
ungroup()
View(PER_2021a)
PER_2021a <- PER_2021a %>%
select(conglome, vivienda, hogar, p401h1, p401h2, p401h3, p401h4, p401h5)
PER_2021a <- PER_2021a %>%
group_by(conglome, vivienda, hogar) %>%
rowwise() %>%
mutate(idh_ch = group_indices()) %>%
ungroup()
PER_2021a <- PER_2021a %>%
mutate(dis_ci = ifelse((p401h1 == 1 | p401h2 == 1 | p401h3 == 1 | p401h4 == 1 | p401h5 == 1), 1, 0))
View(PER_2021a)
PER_2021a %>%
count(dis_ci)
PER_2021a <- PER_2021a %>%
group_by(conglome, vivienda, hogar) %>%
mutate(dis_ch = ifelse(sum(dis_ci, na.rm = T) > 0, 1, 0))
gc()
48483/7000000
path <- "C:/Users/NVIEIRATOSI/OneDrive - Inter-American Development Bank Group/Desktop/GDI/Technical Stewards/armonizacion_censos_poblacion_scl/"
setwd(path)
options(scipen = 999)
rm(list = ls())
set.seed <- 100696
# Set Up ----
library(tidyverse)
library(haven)
path <- "C:/Users/NVIEIRATOSI/OneDrive - Inter-American Development Bank Group/Desktop/GDI/Technical Stewards/armonizacion_censos_poblacion_scl/"
setwd(path)
# Import Data
base_raw <- read_dta("NIC/NIC_2005_censusBID.dta")
getwd()
base_raw <- read_dta("NIC/NIC_2005_censusBID.dta")
path <- "C:/Users/NVIEIRATOSI/OneDrive - Inter-American Development Bank Group/SCL SCL_Gender Data - General/Languages - IN"
setwd(path)
base_raw <- read_dta("NIC_2005_censusBID.dta")
path <- "C:/Users/NVIEIRATOSI/OneDrive - Inter-American Development Bank Group/SCL SCL_Gender Data - General/Languages - IND"
setwd(path)
base_raw <- read_dta("NIC_2005_censusBID.dta")