You can fill up the upper triangular matrix by doing
mat <- matrix(0, nrow = 4, ncol = 4)
mat[upper.tri(mat, diag = TRUE)] <- v
mat
# [,1] [,2] [,3] [,4]
#[1,] 1 2 4 7
#[2,] 0 3 5 8
#[3,] 0 0 6 9
#[4,] 0 0 0 10
Lower triangle doesn't follow the same sequence as upper triangle so doing
mat[lower.tri(mat, diag = TRUE)] <- v
doesn't give the expected outcome.
We can get the indices of lower triangle, order
them according to row and then update the matrix
order_mat <- which(lower.tri(mat, diag = TRUE), arr.ind = TRUE)
mat[order_mat[order(order_mat[, 1]), ]] <- v
mat
# [,1] [,2] [,3] [,4]
#[1,] 1 0 0 0
#[2,] 2 3 0 0
#[3,] 4 5 6 0
#[4,] 7 8 9 10
Or as @Gregor commented a much simpler way is to transpose the upper triangular result
mat <- matrix(0, nrow = 4, ncol = 4)
mat[upper.tri(mat, diag = TRUE)] <- v #Upper triangle
t(mat) #Lower triangle