r中将数据框中数据类型转化
Before we delve deeper into R programming, it is important to understand the various data types used in R. R has the following basic data types:
在深入研究R编程之前 ,了解R中使用的各种数据类型很重要。R具有以下基本数据类型:
- Character 字符
- Numeric 数字
- Integer 整数
- Logical 逻辑上
- Complex 复杂
Apart from these basic types, R also supports several data structures that are constructed from the basic types. These are:
除了这些基本类型,R还支持从基本类型构造的几种数据结构。 这些是:
- Vectors 向量
- Matrices 矩阵
- Arrays 数组
- Dataframes 数据框
- Lists 清单
- Factors 因素
This tutorial will help you understand the basic data types. The working of each complex data structure will be covered in more elaborate tutorials.
本教程将帮助您了解基本数据类型。 每个复杂数据结构的工作都将在更详尽的教程中介绍。
R中的数值数据类型 (Numeric Data Types in R)
Since R is predominantly a language designed for statistical purpose, numeric and integer data types are widely used. We will begin with the most frequently used numeric data type. As the name indicates, numeric corresponds to any numerical value. These values can be floating-point, decimal or double.
由于R主要是为统计目的而设计的语言,因此广泛使用数字和整数数据类型。 我们将从最常用的数字数据类型开始。 顾名思义,数值对应于任何数值。 这些值可以是浮点数ÿ