R language is very intelligent regarding data types. But sometimes it can be confused – see my test set 1, column “dollar”. Because it hase character “$” at the beginning, column is understud as string. But casts are in R very simple and powerfull.

 

> print(as.double(substr(data$dollar,2,99)))
  [1] 6150.22 8729.60 1746.29 4242.62 8161.88 4632.60 3903.53  758.63 4690.15
 [10] 4694.92 9730.40 1796.15 7743.68 4730.74 2342.71 9258.18 2380.85 4657.74
 [19] 5165.43 9442.88 4180.22 6357.11 3893.35 3808.51 5829.73 1977.42 9980.95
 [28] 9010.07    4.09 5389.78 5067.67 9107.65 7488.56 1591.64 4214.10 6488.71
 [37] 8945.61 6459.84   10.24 2903.46 7038.96 3184.07 7327.50 9442.48  666.98
 [46] 4571.98 5403.14 7144.79 3342.90 3563.42 9835.45 5268.41 3985.63 6606.58
 [55] 9653.05 8976.29 3655.01 1061.38 9050.86 5296.75 5611.85 5053.88  221.87
 [64] 3955.72 7170.12 9049.99 9467.89 7184.98 9266.68  720.37 8876.95 8064.11
 [73] 2733.53  433.11 7619.37 4582.12 1598.36 5423.45 2250.27 2523.69 8987.39
 [82] 5008.95 5479.24 6597.49 5740.80 4508.55 2655.85 2698.09 3848.53  616.80
 [91]  507.33 1991.57 3622.22 2216.83 7088.39 8099.97 3622.38  336.46 9510.49
[100] 2042.16