This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.
df = read.csv2("D:\\TAM DAN NON-ORTHO\\01. Non ortho_ORAL MYOFUNCTIONAL EVALUATION WITH SCORE\\1.1. APPEARANCE AND POSTURE.csv")
library("lessR")
## Warning: package 'lessR' was built under R version 4.5.2
##
## lessR 4.5 feedback: gerbing@pdx.edu
## --------------------------------------------------------------
## > d <- Read("") Read data file, many formats available, e.g., Excel
## d is the default data frame, data= in analysis routines optional
##
## Many examples of reading, writing, and manipulating data, graphics,
## testing means and proportions, regression, factor analysis,
## customization, forecasting, and aggregation to pivot tables.
## Enter: browseVignettes("lessR")
##
## View lessR updates, now including modern time series forecasting
## and many, new Plotly interactive visualizations output. Most
## visualization functions are now reorganized to three functions:
## Chart(): type="bar", "pie", "radar", "bubble", "treemap", "icicle"
## X(): type="histogram", "density", "vbs" and more
## XY(): type="scatter" for a scatterplot, or "contour", "smooth"
## Most previous function calls still work, such as:
## BarChart(), Histogram, and Plot().
## Enter: news(package="lessR"), or ?Chart, ?X, or ?XY
## There is also Flows() for Sankey flow diagrams, see ?Flows
##
## Interactive data analysis for constructing visualizations.
## Enter: interact()
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:lessR':
##
## order_by, recode, rename
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(labelled)
## Warning: package 'labelled' was built under R version 4.5.3
# 1. MÃ HÓA VÀ GHI ĐÈ TRỰC TIẾP LÊN BIẾN GỐC
df <- df %>%
mutate(
# --- FACE ---
FA1 = factor(FA1, levels = c(1, 2, 3, 4),
labels = c("Asymmetry severe", "Asymmetry moderate", "Asymmetry light", "Normal")),
FA2 = factor(FA2, levels = c(0, 1, 88),
labels = c("right", "left", "Not record")),
FA3 = factor(FA3, levels = c(1, 2, 3, 4),
labels = c("Altered severe", "Altered moderate", "Altered light", "Normal")),
FA4 = factor(FA4, levels = c(0, 1, 2, 88),
labels = c("Inferior", "Middle", "Superior", "Not record")),
FA5 = factor(FA5, levels = c(1, 2, 3, 4),
labels = c("Marked severe", "Marked moderate", "Marked light", "Normal")),
# --- CHEEK APPEARANCE ---
CA1 = factor(CA1, levels = c(1, 2, 3, 4),
labels = c("Increased severe", "Increased moderate", "Increased light", "Normal")),
CA2 = factor(CA2, levels = c(0, 1, 2, 88),
labels = c("Right", "Left", "Right and left", "Not record")),
CA3 = factor(CA3, levels = c(1, 2, 3, 4),
labels = c("Flaccid/ drooping severe", "Flaccid/ drooping moderate", "Flaccid/ drooping light", "Normal")),
# --- MANDIBLE/ MAXILLA RELATION ---
MMA1 = factor(MMA1, levels = c(1, 2, 3, 4),
labels = c("Severe: With tension/ Altered", "Moderate: With tension/ Altered", "Light: Without tension/ Exceeds freeway", "Normal")),
MMA2 = factor(MMA2, levels = c(1, 2, 3, 4),
labels = c("Altered severe", "Altered moderate", "Altered light", "Normal")),
MMA3 = factor(MMA3, levels = c(0, 1),
labels = c("Positive", "Negative")),
MMA4 = factor(MMA4, levels = c(1, 2, 3, 4),
labels = c("Lateral deviation severe", "Lateral deviation moderate", "Lateral deviation light", "Normal")),
MMA5 = factor(MMA5, levels = c(0, 1),
labels = c("To right", "To left")),
# --- LIPS ---
LA1 = factor(LA1, levels = c(1, 2, 3, 4),
labels = c("Severe effort/ open lips", "Moderate effort/ open lips", "Light effort/ half-open", "Normal")),
LA2 = factor(LA2, levels = c(1, 2, 3, 4),
labels = c("Dysfunction severe", "Dysfunction moderate", "Dysfunction light", "Normal")),
LA3 = factor(LA3, levels = c(1, 2, 3, 4),
labels = c("Dysfunction severe", "Dysfunction moderate", "Dysfunction light", "Normal")),
LA4 = factor(LA4, levels = c(1, 2, 3),
labels = c("Right", "Left", "Both")),
LA5 = factor(LA5, levels = c(0, 1, 2, 3, 4),
labels = c("Very thin", "Thin", "Moderately thick", "Thick", "Full")),
# --- MENTALIS MUSCLE ---
MA = factor(MA, levels = c(1, 2, 3, 4),
labels = c("Increased activity severe", "Increased activity moderate", "Increased activity light", "Normal")),
# --- TONGUE ---
TA1 = factor(TA1, levels = c(1, 2, 3, 4),
labels = c("Severe: exceeds the incisal surfaces...", "Moderate: with marks/ at incisal limit...", "Light: Clenching/ at limit...", "Normal")),
TA2 = factor(TA2, levels = c(0, 1),
labels = c("None", "Interposition")),
TA3 = factor(TA3, levels = c(1, 2, 3, 4),
labels = c("Increased and/or widened severe", "Increased and/or widened moderate", "Increased and/or widened light", "Normal")),
# --- PALATE ---
PA1 = factor(PA1, levels = c(1, 2, 3, 4),
labels = c("Decreased/ narrow severe", "Decreased/ narrow moderate", "Decreased light", "Normal")),
PA2 = factor(PA2, levels = c(1, 2, 3, 4),
labels = c("Increased height/ deep (severe)", "Increased height/ deep (moderate)", "Increased height light", "Normal"))
)
# 2. GẮN LẠI NHÃN MÔ TẢ CHO CÁC BIẾN (Tùy chọn, dùng để ghi chú)
df <- df %>%
set_variable_labels(
FA1 = "Symmetry",
FA2 = "Increased side (if FA1 is not 4)",
FA3 = "Proportion btw thirds of the face",
FA4 = "Increased third of the face (If FA3 is not 4)",
FA5 = "Nasolabial sulcus",
CA1 = "Volume",
CA2 = "Increased side (if CA1 is not 4)",
CA3 = "Tension/ Configuration",
MMA1 = "Vertical mandibular posture with free way space...",
MMA2 = "Anteroposterior relation",
MMA3 = "Overjet",
MMA4 = "Relation with the midline",
MMA5 = "Deviation side",
LA1 = "Resting lips function or closure with effort...",
LA2 = "Volume and configuration...",
LA3 = "Labial commissures Level of rima...",
LA4 = "Side below the rima of mouth",
LA5 = "Lip thickness",
MA = "Contraction not apparent (with lips closure)",
TA1 = "Position/apperearance within oral cavity...",
TA2 = "The interposition",
TA3 = "Appearance/ volume",
PA1 = "Width",
PA2 = "Height"
)