-
Notifications
You must be signed in to change notification settings - Fork 0
/
0220_실습.R
76 lines (64 loc) · 1.33 KB
/
0220_실습.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
## install.packages("dplyr")
library(dplyr)
data1<-read.csv("2013년_프로야구선수_성적.csv")
data1
## 1번
data1<-read.csv("2013년_프로야구선수_성적.csv") %>%
filter(경기>=120)
data1
## 2번
data1<-read.csv("2013년_프로야구선수_성적.csv") %>%
filter((경기>=120) & (득점 >=80))
data1
## 3번
data1<-read.csv("2013년_프로야구선수_성적.csv") %>%
filter((포지션=='1루수') | (포지션=='3루수'))
data1
## 4번
data1<-read.csv("2013년_프로야구선수_성적.csv") %>%
select(선수명,포지션,팀)
data1
## 4번
data1<-read.csv("2013년_프로야구선수_성적.csv") %>%
select(순위:타수)
data1
## 보고서 문제
library(googleVis)
attach(Fruits)
## 1번
data1 <- Fruits %>%
filter(Expenses >80)
data1
## 2번
data1 <- Fruits %>%
filter((Expenses) >90 & (Sales>90))
data1
## 3번
data1 <- Fruits %>%
filter((Expenses) >90 | (Sales>80))
data1
## 4번
data1 <- Fruits %>%
filter(Expenses ==79 | Expenses==91)
data1
## 5번
data1 <- Fruits %>%
select(Fruit:Sales,-Location)
data1
## 6번
data1 <- Fruits %>%
group_by(Fruit)%>%
summarise(average = sum(Sales,na.rm=TRUE))
data1
## 7-1번
data1 <- Fruits %>%
group_by(Fruit)%>%
select(Fruit,Sales,Profit)%>%
summarise(Sales= sum(Sales,na.rm=TRUE))
summarise(Profit=sum(Profit,na.rm=TRUE))
## 7-2번
data1 <- Fruits %>%
group_by(Fruit)%>%
select(Fruit,Sales,Profit)%>%
summarise(Profit=sum(Profit,na.rm=TRUE))
data1