context: 10 files. csv, each file contains an date frame with 5 columns: name, date of birth, sex, attitude, and result. On each line there is a name, date of birth, sex, attitude, and result.
problem: each attitude has a result. each attitude was exported on one line. soon, there are several lines for each registered attitude.
goal: to extract from each of the files, individuals who possess the set of attitudes recorded with their results.
ext {
atlist <- as.list(x1, x2, x3, x4, x5, x6, x7, x8)
library(dplyr)
setwd("~/")
files_list <- list.files(x, full.names=TRUE)
dat <- data.frame()
fim <- data.frame()
for (i in 1:10) {
dat <- (read.csv(files_list[i]))
dat <- dat %>% filter(attitude == "atlist")
fim <- rbind(fim, dat)
}
fim
}
I'm struggling with this for some time. Can someone help me ?