R sqldf()

Jmnote (토론 | 기여)님의 2019년 6월 1일 (토) 02:05 판 (→‎개요)

1 개요

R sqldf()
  • SQL 쿼리를 수행하는 R 함수
library(sqldf)
sqldf("select * from BOD where Time > 4")
##   Time demand
## 1    5   15.6
## 2    7   19.8
library(sqldf)
summary(CO2)
##     Plant             Type         Treatment       conc          uptake     
## Qn1    : 7   Quebec     :42   nonchilled:42   Min.   :  95   Min.   : 7.70  
## Qn2    : 7   Mississippi:42   chilled   :42   1st Qu.: 175   1st Qu.:17.90  
## Qn3    : 7                                    Median : 350   Median :28.30  
## Qc1    : 7                                    Mean   : 435   Mean   :27.21  
## Qc3    : 7                                    3rd Qu.: 675   3rd Qu.:37.12  
## Qc2    : 7                                    Max.   :1000   Max.   :45.50  
## (Other):42                                                                  
sqldf("SELECT * FROM CO2 WHERE Plant LIKE 'Qn%' LIMIT 10")
##    Plant   Type  Treatment conc uptake
## 1    Qn1 Quebec nonchilled   95   16.0
## 2    Qn1 Quebec nonchilled  175   30.4
## 3    Qn1 Quebec nonchilled  250   34.8
## 4    Qn1 Quebec nonchilled  350   37.2
## 5    Qn1 Quebec nonchilled  500   35.3
## 6    Qn1 Quebec nonchilled  675   39.2
## 7    Qn1 Quebec nonchilled 1000   39.7
## 8    Qn2 Quebec nonchilled   95   13.6
## 9    Qn2 Quebec nonchilled  175   27.3
## 10   Qn2 Quebec nonchilled  250   37.1

2 같이 보기

3 참고

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