'How to change character into numeric of a dataframe within a list in R?

I would like to convert a character vector within a dataframe of a list into a numeric one. I have an example attached. Data at the end looks like my list I import directly into R and in which I want to convert character into numeric...

set.seed(94756)

mat1 <- matrix(sample(seq(-1,100, 0.11),50, replace = TRUE),ncol = 5) 
mat1 <- as.data.frame(mat1)
mat1$V2 <- as.character(mat1$V2)

mat2 <- matrix(sample(seq(-1,100, 0.11),50, replace = TRUE),ncol = 5)  
mat2 <- as.data.frame(mat2)
mat2$V2 <- as.character(mat2$V2)

mat3 <- matrix(sample(seq(-1,100, 0.11), 50,replace = TRUE),ncol = 5)  
mat3 <- as.data.frame(mat2)
mat3$V2 <- as.character(mat3$V2)

data <- list(mat1, mat2, mat3)

Thanks in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source