簡體   English   中英

什么是R函數scipy.sparse.bmat的R等價物?

[英]What is the R equivalent of Python function scipy.sparse.bmat?

是否有R等價的Python函數scipy.sparse.bmat

特定於我的代碼的特殊解決方案。 Python代碼如下所示:

P = sparse.bmat([[None, W], [F, None]])

其中W和F是兩個稀疏矩陣。 等效的R代碼:

blk1 = Matrix::sparseMatrix(i=1,j=1,x=0,dims=c(nrow(W),ncol(F)))
blk2 = Matrix::sparseMatrix(i=1,j=1,x=0,dims=c(nrow(F),ncol(W)))
P=rbind(cbind(blk1,W),cbind(F,blk2))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM