I am fairly new to R so excuse my baby steps in plotly. I am trying to compute density curves for total time spent
# Compute density curves
d.Bardoc <- AeDec %>%
filter(Bardoc == 1) %>%
density(AeDec$TotalTimeinAE) ##, na.rm = TRUE)
But I keep getting the following error:
Error in density.default(., AeDec$TotalTimeinAE) :
argument 'x' must be numeric
I've checked that TotalTimeinAE is numeric with str(AeDec)
:
$ TotalTimeinAE: num 315 94 470 29 17 9 11 101 23 107 ...
What do I need to do to be able to calculate density curve for this variable?