Hello I am doing a data mining job in which I try to classify Twitter users to know if they are teachers or not, then according to the words I must copy their screenname and then search in their description as follows the following code:
library(twitteR)
library (tidyverse)
palabras = c("dolor", "cansado", "#agotado")
todosTwits = list()
for(i in seq((palabras))){
todosTwits[[i]] = searchTwitter(palabras[c(i)], n=100)
}
todosTwits %>%
map_df(as_tibble) #I become tbl
listaUsuarios = list()
#recorrer todos los twits:
#todosTwits$screenName
for(name in todosTwits$screenName){
if (!(name%in%listaUsuarios)){
append(listaUsuarios,name)
}
}
#buscar usuarios
usrs <- lookupUsers(listaUsuarios)
usrs
#convertir a dataset
usuarios <- data.frame(usrs)
#calcular el tamaño de filas
tam = dim(usuarios)[1]
listaDocentes = c()
for(i in seq(tam)){
print(usuarios[c(i,1)]$description)
if ("docente" %in% usuarios[c(i,1)]$description){
listaDocente.append(usuarios[c(i,1)]$screenName)
}
}
To begin with, I cannot convert the todosTwits
list into tbl since I need that format to be able to obtain the user's name and then display its description and classify it.
I would like you to help me in that case or give me some advice for this activity, please.