2013-07-19 18:13:50 8 Comments

Let's say I have a vector in R as follows:

```
d<-seq(1,100)
```

I want to reshape this vector into a 10x10 matrix, so that I will have this data instead:

```
[,1] [,2] [,3] .. [,10]
1 2 3 .. 10
11 12 13 .. 20
21 22 23 .. 30
..
91 92 93 .. 100
```

I tried to use reshape function, but it didn't work. Can someone help please?

### Related Questions

#### Sponsored Content

#### 10 Answered Questions

### [SOLVED] Convert data.frame column to a vector?

**2011-08-15 20:08:35****Dolan Antenucci****304683**View**136**Score**10**Answer- Tags: r dataframe vector type-conversion

## 2 comments

## @jared 2018-06-23 03:16:59

If you want to convert a predifined list to a matrix (e.g. a 5*4 matrix), do

It is worth noting that the matrix is created by columns, which means your data will be

filled into the matrix by columns. So, if you want to the matrix created by rows, simply using, such ast()## @flodel 2013-07-19 18:17:02

You can do

or