我有一个像矩阵
A= [ 1 2 4
2 3 1
3 1 2 ]
Run Code Online (Sandbox Code Playgroud)
我想按行和按列计算累积总和,也就是说,我希望得到结果
B = [ 1 3 7
3 8 13
6 12 19 ]
Run Code Online (Sandbox Code Playgroud)
有关如何快速在R中制作此内容的任何想法?(可能使用函数cumsum)(我有巨大的矩阵)
谢谢!
我必须在R里面运行一个shell脚本.我考虑过使用R的system函数.
但是,我的脚本涉及source activate/ bin/sh shell中没有的其他命令.有没有办法可以使用/ bin/bash代替?
谢谢!