Hi,

What is the actual difference between the two functions to create matrices in r, matrix() and as.matrix()?

I get same result when applying the two functions

dt=c(1:6)

as.matrix(dt)

[,1]

[1,] 1

[2,] 2

[3,] 3

[4,] 4

[5,] 5

[6,] 6

matrix(dt)

[,1]

[1,] 1

[2,] 2

[3,] 3

[4,] 4

[5,] 5

[6,] 6

Thanks.