The code:
a <- structure(list(`X$Days` = c("10", "38", "66", "101", "129", "185", "283",
"374")), .Names = "X$Days")
Then a is like
$`X$Days`
[1] "10" "38" "66" "101" "129" "185" "283" "374"
I would like to coerce a to an array of numeric values, but coercing functions return me
Error: (list) object cannot be coerced to type 'double'
Thanks,
If you want to convert all elements of
ato a single numeric vector andlength(a)is greater than 1 (OK, even if it is of length 1), you couldunlistthe object first and then convert.Bear in mind that there aren’t any quality controls here. Also,
X$Daysa mighty odd name.