This works:
all_names <- unique(df$Name)
num_cols <- length(all_names)
num_rows <- max(df$Value)
mat <- matrix(0L, num_rows, num_cols,
dimnames = list(NULL, all_names))
mat[cbind(df$Value, match(df$Name, all_names))] <- 1L
mat
# Tom Dave Frank Ri
# [1,] 1 1 1 0
# [2,] 0 1 0 0
# [3,] 0 0 1 0
# [4,] 1 0 0 1
# [5,] 0 0 0 1
My question about how sparse the matrix is was not innocent. If it is very sparse, you have interest to use a sparse matrix as it will use a lot less memory:
library(Matrix)
mat <- sparseMatrix(i = df$Value, j = match(df$Name, all_names), x = 1L,
dimnames = list(NULL, all_names))