myfile.txt
- это ваш файл данных.
# read csv file as data frame
df <- read.table(file = "myfile.txt", header = FALSE, sep = ",", stringsAsFactors = FALSE)
# remove square brackets and convert character to numeric class
df[] <- lapply(df, function(x) as.numeric(gsub(x = x, pattern = "\\[|\\]", replacement = "")))