'1D data frame to 2D format in R
My data is in a 1 column x 40000 row data frame. I would like to make it a 200 column x 200 row data frame. When I was using all numeric values, I used the code below to transform my vector into a matrix.
spematrix=data.matrix(spe)
matrix = matrix(spematrix, nrow = 200, ncol=200)
I cannot use this now though because my data contains non-numeric values (numbers separated by commas).
I am new to R and would appreciate any help.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
