I am using R markdown and trying to extract the output of the summary function into a nice table but the actual values that are coming in the output are not extracted into the table.
Library(tidyverse)
Library(kableextra)
ATT <- read_excel('E:/MY PROJECTS/OSTEOTOMY ACL/ATT.xlsx')
Flexion_Degrees Load_Direction Load_N Osteotomy_Type PTS_Degrees Paper ATT_ACL
30 Anterior 134 Native 0 Nelitz 5.5
90 Anterior 134 Native 0 Nelitz 4
30 Anterior 134 AOWO 5 Nelitz 5.8
90 Anterior 134 AOWO 5 Nelitz 4
summary(ATT)
I got an output like that
Flexion_Degrees Load_Direction Load_N
Min. :15 Length:30 Min. : 18.0
1st Qu.:30 Class :character 1st Qu.:100.0
Median :30 Mode :character Median :134.0
Mean :39 Mean :179.3
3rd Qu.:30 3rd Qu.:206.8
Max. :90 Max. :400.0
Then I used
ATT_STATS_Table <- ATT %>%
select(PTS_Degrees,Flexion_Degrees,ATT_ACL,Load_N)
as.data.frame(apply(ATT_STATS_Table,2,summary)) %>%
kbl() %>%
kable_styling()
And the output is like that with no values?
PTS_DegreesFlexion_DegreesATT_ACLLoad_NLength30303030ClasscharactercharactercharactercharacterModecharactercharactercharactercharacter