Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206305

R Plotly density plot argument 'x' must be numeric

$
0
0

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?


Viewing all articles
Browse latest Browse all 206305

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>