"R csv 파일 읽기"의 두 판 사이의 차이

(같은 사용자의 중간 판 하나는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;R csv 파일 읽기
;R csv 파일 읽기
{{소스헤더|로컬 csv 파일 읽기 (윈도우)}}
<source lang='r'>
df2 <- read.csv("D:/data/DiplomacySummary.csv")
str(df2)
## 'data.frame': 35 obs. of  7 variables:
##  $ Game.Turn : int  4 4 4 5 5 6 6 6 7 7 ...
##  $ Initiator : int  1 9 1 13 12 3 14 3 0 3 ...
##  $ Recipient : int  9 1 9 12 13 14 3 14 3 0 ...
##  $ Action    : Factor w/ 4 levels " Declared Friends",..: 4 4 3 4 4 4 4 3 4 4 ...
##  $ Details  : logi  NA NA NA NA NA NA ...
##  $ Mayhem    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ Visibility: int  0 0 0 0 0 0 0 0 0 0 ...
</source>
<source lang='r'>
df1 <- read.csv("D:\\data\\DiplomacySummary.csv")
str(df1)
## 'data.frame': 35 obs. of  7 variables:
##  $ Game.Turn : int  4 4 4 5 5 6 6 6 7 7 ...
##  $ Initiator : int  1 9 1 13 12 3 14 3 0 3 ...
##  $ Recipient : int  9 1 9 12 13 14 3 14 3 0 ...
##  $ Action    : Factor w/ 4 levels " Declared Friends",..: 4 4 3 4 4 4 4 3 4 4 ...
##  $ Details  : logi  NA NA NA NA NA NA ...
##  $ Mayhem    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ Visibility: int  0 0 0 0 0 0 0 0 0 0 ...
</source>
{{소스헤더|웹상의 csv 파일 읽기}}
<source lang='r'>
<source lang='r'>
df <- read.csv("https://raw.githubusercontent.com/pandas-dev/pandas/master/pandas/tests/data/iris.csv")
df <- read.csv("https://raw.githubusercontent.com/pandas-dev/pandas/master/pandas/tests/data/iris.csv")

2019년 9월 20일 (금) 20:23 판

1 개요

R csv 파일 읽기
로컬 csv 파일 읽기 (윈도우)
df2 <- read.csv("D:/data/DiplomacySummary.csv")
str(df2)
## 'data.frame':	35 obs. of  7 variables:
##  $ Game.Turn : int  4 4 4 5 5 6 6 6 7 7 ...
##  $ Initiator : int  1 9 1 13 12 3 14 3 0 3 ...
##  $ Recipient : int  9 1 9 12 13 14 3 14 3 0 ...
##  $ Action    : Factor w/ 4 levels " Declared Friends",..: 4 4 3 4 4 4 4 3 4 4 ...
##  $ Details   : logi  NA NA NA NA NA NA ...
##  $ Mayhem    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ Visibility: int  0 0 0 0 0 0 0 0 0 0 ...
df1 <- read.csv("D:\\data\\DiplomacySummary.csv")
str(df1)
## 'data.frame':	35 obs. of  7 variables:
##  $ Game.Turn : int  4 4 4 5 5 6 6 6 7 7 ...
##  $ Initiator : int  1 9 1 13 12 3 14 3 0 3 ...
##  $ Recipient : int  9 1 9 12 13 14 3 14 3 0 ...
##  $ Action    : Factor w/ 4 levels " Declared Friends",..: 4 4 3 4 4 4 4 3 4 4 ...
##  $ Details   : logi  NA NA NA NA NA NA ...
##  $ Mayhem    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ Visibility: int  0 0 0 0 0 0 0 0 0 0 ...
웹상의 csv 파일 읽기
df <- read.csv("https://raw.githubusercontent.com/pandas-dev/pandas/master/pandas/tests/data/iris.csv")
str(df)
## 'data.frame':	150 obs. of  5 variables:
##  $ SepalLength: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
##  $ SepalWidth : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
##  $ PetalLength: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
##  $ PetalWidth : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
##  $ Name       : Factor w/ 3 levels "Iris-setosa",..: 1 1 1 1 1 1 1 1 1 1 ...

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}