This works:
# get data in useable form
ContingencyTable <- read.table(text=gsub(pattern = " --- ", replacement = ",","User ID 1 --- Artist 5
User ID 2 --- Artist 1
User ID 3 --- Artist 7
User ID 4 --- Artist 2
User ID 5 --- Artist 3
User ID 1 --- Artist 2
User ID 3 --- Artist 1"),sep=",", stringsAsFactors = FALSE)
# add variable for match value
ContingencyTable$Val <- 1
# more or less lifted from Arun's answer linked by @Hong Ooi, above
adjMat <- reshape2::dcast(ContingencyTable, V1 ~ V2, value.var = "Val", fill=0)
rownames(adjMat) <- adjMat[,1]
adjMat <- adjMat[,2:ncol(adjMat)]
adjMat
Artist 1 Artist 2 Artist 3 Artist 5 Artist 7
User ID 1 0 1 0 1 0
User ID 2 1 0 0 0 0
User ID 3 1 0 0 0 1
User ID 4 0 1 0 0 0
User ID 5 0 0 1 0 0