我有一个包含大约1000个单个整数的列表。我需要进行一些数学计算,但它们被困在列表或字符形式中。我该如何将它们转换为可用的形式?
示例数据:
> y [[1]]
[1] "7" "3" "1" "6" "7" "1" "7" "6" "5" "3" "1" "3" "3" "0" "6" "2" "4" "9"
[19] "1" "9" "2" "2" "5" "1" "1" "9" "6" "7" "4" "4" "2" "6" "5" "7" "4" "7"
[37] "4" "2" "3" "5" "5" "3" "4" "9" "1" "9" "4" "9" "3" "4" "9" "6" "9" "8"
[55] "3" "5" "2" "0" "3" "1" "2" "7" "7" "4" "5" "0" "6" "3" "2" "6" "2" "3"
[73] "9" "5" "7" "8" "3" "1" "8" "0" "1" "6" "9" "8" "4" "8" "0" "1" "8" "6" ...
仅显示前几行。
as.numeric(y[[1]])
。 - Joshua Ulrich