I would like to perform a filter in R. I have a database with 5 variables and more than 5000 rows. One of my variables is "room", in which I have 29 room (ex: room 1, room 2 ...).
I would like to perform a filter, to filter all the information it contains in my database for a certain room, and then export that information into a csv file.
I made a program, but it is not stored right in a csv file. I would like someone to give me a tip to better my code and / or help me solve this storage problem. Below is my code.
dados=read.csv("C:/teste/dados.csv", sep=";",header=TRUE)
nome=dados$nome
perfil=dados$perfil
sala=dados$sala
forum=dados$forum
mensagem=dados$mensagem
BD=data.frame(nome,perfil,sala,forum,mensagem)
x2=subset(nome,sala=="(T2/14/EI) D01 - Diversidade e Cultura Inclusiva")
x3=subset(perfil,sala=="(T2/14/EI) D01 - Diversidade e Cultura Inclusiva")
x6=subset(sala,sala=="(T2/14/EI) D01 - Diversidade e Cultura Inclusiva")
x7=subset(forum,sala=="(T2/14/EI) D01 - Diversidade e Cultura Inclusiva")
x10=subset(mensagem,sala=="(T2/14/EI) D01 - Diversidade e Cultura Inclusiva")
dados1=paste(x2,x3,x6,x7,x10,sep=";")
cat("nome;perfil;sala;forum;mensagem", dados1, file="arquivo.csv", sep="\n",header=T)