GCS sketch

GCS sketch

R Programming 수강생 여러분들께

Glasgow Coma Scale을 참고하거나 간단한 계산을 할 수 있는 단순한 패키지입니다. ( Minimum viable product )

설치

설치는 다음과 같이 하면 됩니다.

install.packages("devtools")
devtools::install_github("shanmdphd/glasgowcoma")

실행

실행은 다음과 같이 하면 됩니다.

library(glasgowcoma)
glasgowComaScale
##    ID  Class Score
## 1  E1    Eye     1
## 2  E2    Eye     2
## 3  E3    Eye     3
## 4  E4    Eye     4
## 5  V1 Verbal     1
## 6  V2 Verbal     2
## 7  V3 Verbal     3
## 8  V4 Verbal     4
## 9  V5 Verbal     5
## 10 M1  Motor     1
## 11 M2  Motor     2
## 12 M3  Motor     3
## 13 M4  Motor     4
## 14 M5  Motor     5
## 15 M6  Motor     6
##                                                         Value
## 1                                          Does not open eyes
## 2                   Opens eyes in response to painful stimuli
## 3                             Opens eyes in response to voice
## 4                                    Opens eyes spontaneously
## 5                                             Makes no sounds
## 6                                     Incomprehensible sounds
## 7                                     Utters incoherent words
## 8                                        Confused disoriented
## 9                                 Oriented converses normally
## 10                                         Makes no movements
## 11        Extension to painful stimuli (decerebrate response)
## 12 Abnormal flexion to painful stimuli (decorticate response)
## 13                    Flexion / Withdrawal to painful stimuli
## 14                                  Localizes painful stimuli
## 15                                             Obeys commands
reportgcs() # Defualt argument
## [1] "GCS 15 = E4 V5 M6 at 2017-12-07 16:00:42 Normal or Minor brain injury suspected"
reportgcs(eye = 4, verbal = 4, motor = 4)
## [1] "GCS 12 = E4 V4 M4 at 2017-12-07 16:00:42 Moderate brain injury suspected"
reportgcs(simplify = FALSE) # Full report
## $summary
## [1] "GCS 15 = E4 V5 M6 at 2017-12-07 16:00:42"
## 
## $analysis
## [1] "Normal or Minor brain injury suspected"
## 
## $description
##    ID  Class Score                       Value
## 4  E4    Eye     4    Opens eyes spontaneously
## 9  V5 Verbal     5 Oriented converses normally
## 15 M6  Motor     6              Obeys commands
reportgcs(3, 3, 4, now = "2017-01-01 11:25", simplify = FALSE) # custom time
## $summary
## [1] "GCS 10 = E3 V3 M4 at 2017-01-01 11:25"
## 
## $analysis
## [1] "Moderate brain injury suspected"
## 
## $description
##    ID  Class Score                                   Value
## 3  E3    Eye     3         Opens eyes in response to voice
## 7  V3 Verbal     3                 Utters incoherent words
## 13 M4  Motor     4 Flexion / Withdrawal to painful stimuli
reportgcs(verbal = 2.5) # Error
## Error in reportgcs(verbal = 2.5): Only integer is acceptable.
reportgcs(verbal = "erlk") # Error
## Error in reportgcs(verbal = "erlk"): Only integer is acceptable.

수정

CLI에서 git clone https://github.com/shanmdphd/glasgowcoma.git 하거나 오른쪽 위의 초록색 버튼을 클릭해서 zip파일을 다운로드 한 뒤 압축을 풀고 소스를 수정 할 수 있습니다.

roxygen2 패키지를 사용하면 문서 작업을 쉽게 할 수 있습니다. 각 함수의 앞에 #' 으로 시작하는 주석을 각각 달고 다음의 함수를 실행하면 NAMESPACERd 파일을 자동으로 고쳐줍니다. 직접 Rd 파일을 수정하는 것보다 간소하다고 많은 사람들이 말하곤 합니다.

library(roxygen2)
roxygenize()