-
Notifications
You must be signed in to change notification settings - Fork 3
/
Graph.Rmd
73 lines (55 loc) Β· 1.75 KB
/
Graph.Rmd
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
---
title: "Rmarkdown Report"
author: "AMC Subinterns"
date: "2016-08-11"
output:
html_document:
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
library(knitr)
library(tidyverse)
# setwd("D:/Subintern/WNL")
```
## 2016 Summer
- μλΈμΈν΄ μ΄μ§μ, μ΄μ’
ν¬ μ μλ
- νμ±ν μμ±
```{r}
PKRaw <- read.csv("data-raw/assay/Drug_X_PK.csv", stringsAsFactors = FALSE)
DosePK <- PKRaw %>%
select(ID, DV, GENE, Drug, TIME) %>%
group_by(ID) %>%
mutate(RankDV = min_rank(desc(DV))) %>%
filter(RankDV == 1) %>%
select(ID, Tmax = TIME, Cmax = DV, GENE, Drug) %>%
group_by(Drug) %>%
summarise(Tmax.Median = median(Tmax), Cmax.Mean = mean(Cmax))
# -> this result will be used to draw plot.
kable(DosePK)
```
μ νλ Doseμ λ°λ₯Έ T~max~μ C~max~λ₯Ό μ 리ν κ²μ
λλ€.
$$
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix}
$$
## 그림 그리기
μ§κΈλΆν°λ μμμ μμ
ν μλ£λ₯Ό μ΄μ©νμ¬ κ·Έλ¦Όμ κ·Έλ €λ³΄κ² μ΅λλ€.
```{r}
TidyDosePK <- gather(DosePK, key = PARAMETER, VALUE, Tmax.Median:Cmax.Mean)
ggplot(TidyDosePK, aes(x = Drug, y = VALUE, color = PARAMETER)) +
geom_point() +
geom_line()
```
μ©λμ΄ μ¦κ°ν λ C~max~μ νκ· μ μ¦κ°νλ©°, T~max~ μ€μκ°μ ν° λ³νκ° μλ κ²μ μ μ μμ΅λλ€.
```{r}
TidyPK <-
read.csv("data-raw/wnl/Xproject_Final Parameters Pivoted.csv") %>%
gather(WNLPARAMTER, WNLVALUE, -ID)
ggplot(TidyPK, aes(x = ID, y = WNLVALUE, color = WNLPARAMTER)) +
geom_point() +
geom_line()
```