-
Frequency Table : 빈도표R 2018. 11. 7. 00:04
# 예제 데이터 : ggplot2::diamonds
install.packages("ggplot2")
library(ggplot2)# 1. 기본 기능
sort(table(diamonds$cut), decreasing = TRUE) # 빈도
round(sort(prop.table(table(diamonds$cut))*100, decreasing = TRUE), digits = 1)# 2. prettyR::freq()
install.packages("prettyR")
library(prettyR)
prettyR::freq(diamonds$cut)# 3. janitor::tabyl()
install.packages("janitor")
library(janitor)
janitor::tabyl(diamonds$cut)# 4. epiDisplay::tab1()
install.packages("epiDisplay")
library(epiDisplay)
epiDisplay::tab1(diamonds$cut, sort.group = "decreasing", cum.percent = TRUE)# 5. summarytools::freq()
install.packages("summarytools")
library(summarytools)
summarytools::freq(diamonds$cut, order = "freq")# 6. questionr::freq()
install.packages("questionr")
library(questionr)
questionr::freq(diamonds$cut, cum = TRUE, sort = "dec", total = TRUE)'R' 카테고리의 다른 글
수학적 주석 넣기(Mathematical Annotation in R) (0) 2018.11.07 결측값(Missing Value) 처리하기 (0) 2018.11.07 pu (0) 2018.11.05 정규표현식 : escape sequence (0) 2018.10.27 정규표현식 : 수량자 (0) 2018.10.27