R语言实战——矩阵与列表的操作示例
Posted 零基础学数据分析
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了R语言实战——矩阵与列表的操作示例相关的知识,希望对你有一定的参考价值。
矩阵与列表的操作示例
01
矩阵
矩阵行列命名示例


矩阵索引示例

矩阵的运算
矩阵加减乘除一个数,则每个位置上的数据都加减乘除该数;若矩阵加减矩阵(此时须行列数目一致),则两矩阵对应位置加减

矩阵的内积(对应位置相乘)和外积

diag()取出对角线上的值,t()求逆矩阵

02
列表
定义:在模式上与向量类似,都是一维数据集合;列表中的对象可以是R中的任何数据结构,甚至列表本身
创建列表示例


列表的访问


我知道你在看哟
以上是关于R语言实战——矩阵与列表的操作示例的主要内容,如果未能解决你的问题,请参考以下文章
R语言实战应用精讲50篇(二十八)-大量代码示例带你从基础到高级(附R语言代码)