transform函数

在console终端中敲入:?transform

Transform an Object,for Example a Data Frame

Description

transform is a generic function,which at-least currently-only does anything useful with data frame.transform default converts its first argument to a data frame if possible and calls tranform.data.frame.

作用:为原数据框添加新的列,改变原变量列的值,还可通过赋值NULL删除列变量。

利用自带数据集BOD:

R语言学习笔记之transform函数

使用transform函数后:

R语言学习笔记之transform函数

还可以删除某列:

R语言学习笔记之transform函数

关于更多的应用在以后的学习使用过程中还需要慢慢去练习。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-11-28
猜你喜欢
  • 2022-01-16
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案