Created
July 26, 2017 07:13
-
-
Save enujo/4eed66df55b36a77c0ab8ce9f230e0c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getwd() | |
# read.table() : 외부파일에서 데이터 프레임으로 값을 가져온다 | |
dfData <- read.table("./BigData/employee.txt") | |
dfData | |
# 데이터에서 열이름과 행이름이 지정된 경우에 해당하는 조건을 지정하여 생성 | |
# read.table(파일명, row.name='행구분 열이름', header=T|F) | |
dfData <- read.table("./BigData/employee.txt",row.names='no',header=T) | |
dfData | |
# 데이터프레임에서 각각의 정보를 선택할 때는 리스트와 동일 | |
dfData$name | |
class(dfData$name) | |
# 데이터프레임으로 행렬을 변환 as.data.frame() | |
m <- matrix(c(1:10),nrow=5) | |
m | |
class(m) | |
matrixDf <- as.data.frame(m) | |
matrixDf | |
class(matrixDf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment