How to coerce a list object to type ‘double’
If you want to convert all elements of a to a single numeric vector and length(a) is greater than 1 (OK, even if it is of length 1), you could unlist the object first and then convert. Bear in mind that there aren’t any quality controls here. Also, X$Days a mighty odd name.