I have the following files in my working directory:
Dados_1.fst
Dados_2.fst
Dados_3.fst
Dados_4.fst
...
Dados_10.fst
The file Data_x.fst (where x is from 1 to 10) has the columns CODE, INSCRIPTION, ANSWER_A, ANSWER_B
Then I create the following data frames:
df.1 <- select(filter(read.fst("Dados_1.fst"), CODIGO ==
10102),INSCRICAO,RESPOSTAS_A,RESPOSTAS_B)
df.2 <- select(filter(read.fst("Dados_2.fst"), CODIGO ==
10102),INSCRICAO,RESPOSTAS_A,RESPOSTAS_B)
df.3 <- select(filter(read.fst("Dados_3.fst"), CODIGO ==
10102),INSCRICAO,RESPOSTAS_A,RESPOSTAS_B)
...
df.10 <- select(filter(read.fst("Dados_10.fst"), CODIGO ==
10102),INSCRICAO,RESPOSTAS_A,RESPOSTAS_B)
I would like to loop such that I did not have to write the above code 10 times.
I tried to follow the path below, but without success
for (i in 1:10)
{
paste("df",i, sep =".") <- select(filter(read.fst(paste(paste("Dados",i,sep="_"),"fst",sep =".")),
CODIGO == 10102),INSCRICAO,RESPOSTAS_A,RESPOSTAS_B)
}
Up to +