I have a data like below;
data<-list(X2019 = structure(1:14, .Label = c(" 0.439", " 0.877", " 1.316",
" 2.305", " 3.903", " 7.552", "11.328", "14.034", "16.770", "17.787",
"23.544", "27.241", "28.037", "38.508"), class = "factor"), X2020 = structure(1:14, .Label = c(" 0.962000",
" 1.708000", " 2.201333", " 3.626111", " 6.061444", " 9.514000",
"11.430889", "12.548556", "13.827000", "15.139333", "17.439667",
"21.050333", "24.804444", "28.883333"), class = "factor"), X2021 = structure(1:14, .Label = c(" 1.466750",
" 2.755625", " 3.940125", " 6.700750", "10.619125", "13.989750",
"17.152250", "17.721125", "21.121625", "23.826625", "24.970000",
"25.686375", "31.951125", "32.904875"), class = "factor"), X2022 = structure(1:14, .Label = c(" 1.316143",
" 2.393143", " 3.222143", " 4.903429", " 6.907571", "10.248714",
"11.352000", "13.680286", "14.364286", "14.797000", "17.181000",
"19.829571", "20.797714", "25.384429"), class = "factor"), X2023 = structure(1:14, .Label = c(" 1.717000",
" 3.274571", " 4.711857", " 7.307571", "11.694429", "17.294571",
"20.463000", "20.948143", "22.685429", "22.718714", "25.589286",
"29.122857", "29.790429", "32.740857"), class = "factor"), X2024 = structure(1:14, .Label = c(" 1.654000",
" 2.559857", " 3.088143", " 4.371143", " 6.263286", " 8.821286",
" 8.857000", "10.344714", "10.799286", "12.797571", "12.941286",
"12.967000", "13.844429", "14.242429"), class = "factor"))
As you can see element types are factor
.
But I want to convert them to double
.
out<-list(`2019` = c(0.439, 0.877, 1.316, 2.305, 3.903, 7.552, 11.328,
14.034, 17.787, 16.77, 23.544, 28.037, 27.241, 38.508), `2020` = c(0.962,
1.708, 2.20133333333333, 3.62611111111111, 6.06144444444444,
9.514, 11.4308888888889, 12.5485555555556, 13.827, 15.1393333333333,
17.4396666666667, 21.0503333333333, 24.8044444444444, 28.8833333333333
), `2021` = c(1.46675, 2.755625, 3.940125, 6.70075, 10.619125,
13.98975, 17.15225, 17.721125, 23.826625, 21.121625, 25.686375,
24.97, 31.951125, 32.904875), `2022` = c(1.31614285714286, 2.39314285714286,
3.22214285714286, 4.90342857142857, 6.90757142857143, 10.2487142857143,
11.352, 13.6802857142857, 14.797, 14.3642857142857, 17.181, 19.8295714285714,
20.7977142857143, 25.3844285714286), `2023` = c(1.717, 3.27457142857143,
4.71185714285714, 7.30757142857143, 11.6944285714286, 17.2945714285714,
20.463, 20.9481428571429, 22.6854285714286, 25.5892857142857,
22.7187142857143, 29.7904285714286, 29.1228571428571, 32.7408571428571
), `2024` = c(1.654, 2.55985714285714, 3.08814285714286, 4.37114285714286,
6.26328571428571, 8.857, 8.82128571428571, 10.3447142857143,
10.7992857142857, 12.7975714285714, 12.9412857142857, 13.8444285714286,
12.967, 14.2424285714286))
I tried as.numeric, as.characteristic codes but I got errors.
I need to see my elements as double.