在學習讀入數據表格時要用到txr.talbe將csv文件轉化為數據框形式,特此查了一下
數據框是r中最常見的原始數據形式,類似於數據庫表或Excel數據表的形式
Data Frames
Description
The function data.frame() creates data frames, tightly coupled collections of variables which share many of the properties of matrices and of lists, used as the fundamental data structure by most of R's modeling software.
Usage
data.frame(..., row.names = NULL, check.rows = FALSE,
check.names = TRUE, fix.empty.names = TRUE,
stringsAsFactors = default.stringsAsFactors())
但實際上只是read.csv()函數以數據框的格式將csv導入r中創建的tax.tab,如下代碼
tax.tab <- read.csv("taxsamp.csv", header=TRUE, as.is=TRUE)
print(head(tax.tab))
read.csv()
Reads a file in table format and creates a data frame from it, with cases corresponding to lines and variables to fields in the file.
Assignment Operators <-
Assign a value to a name.
Usage
x <- value