Might be a very silly question, but I cannot seem to find a proper way to create a sparse diagonal matrix in R. I've found the functions:
diag.spam()
spdiags()
and used them with library Matrix
and package spam
downloaded, but R did not seem to recognize these functions. Does anyone know a function or library I need to download?
I need it because I want to create diagonal matrices larger than 256 by 256.