R language learning problem solving error in output $nodeid: $operator is invalid for atomic vectors

Problem: Error in output$nodeID: $operator is invalid for atomic Vectors when viewing variable columns using the “$” operator

output <- data$score
output <- cbind(nodeID=dat$nodeID,score=output)
 Error in output$nodeID : $ operator is invalid for atomic vectors
# Check the type of output and find out it's matrix.
 [1] "matrix"
#"data.frame" can only be used with "$", just use [,] here.



Read More: