2
I need to convert a field from a char file to something that is calculable to average.
It is a field that refers to hours originally.
system.time(cpc_call<-fread("ACIONAMENTO_CALL.csv",header = T , sep= ";")) # Importa tabela
When I see the imported file it appears as Chr.
So in an attempt to convert , I made the code below:
cpc_call$Tempo_Falado = as.numeric(cpc_call$Tempo_Falado) # Transforma tempo falado em tempo
cpc_call %>%
group_by(Outcome) %>%
summarise(median(cpc_call$Tempo_Falado))
But the result of the column referring to media returns only "NA"
Edit : Follows the exit with : dput(head(cpc_call$Spoken, 20))
> dput(head(cpc_call$Tempo_Falado, 20))
c("00:01:20", "00:01:46", "00:01:36", "00:05:26", "00:01:37",
"00:05:11", "00:02:34", "00:01:32", "00:01:44", "00:02:51", "00:02:45",
"00:01:45", "00:02:22", "00:02:04", "00:03:17", "00:01:59", "00:01:44",
"00:01:31", "00:01:23", "00:01:43")
How are you
cpc_call$Tempo_Falado
before the code starts? Give some examples that make it easier for people to help.– PedroMVM
It helped, because before that I only have the lib and the setwd?
– Orsolan
Put the exit of
dput(head(cpc_call$Tempo_Falado, 20))
question. So we can have an exact copy of the data and see what the problem is and the solution.– Rui Barradas