How to use the R language tableone package
This article mainly explains "how to use the R language tableone package". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use the R language tableone package.
Let's take an example:
Enter 1:
# for the first time, install install.packages ('tableone') # call after installation # check the dataset head (dt,10) # the dataset is virtual data randomly made up by Xiaobian.
Output 1:
# A tibble: 10 x 9 gender age whether drinking pathological type differentiation ALT AST detection Group 1 female 44 is pathological type I 22 21 8.29 experimental group 2 female 52 is pathological type I 24 4.7 experimental group 3 male 55 Pathological type I 30 32.3 6.8 experimental group 4 male 50 no pathological type 20 16 4.16 experimental group 5 female 64 pathological type I 13 8 10 experimental group 6 female 24 pathological type I 14.6 10.8 15 experimental group 7 male 66 No pathological type I 51.6 22.3 8.32 experimental group 8 female 43 pathological type 21 25 10.2 experimental group 9 female 52 pathological type I 16 18 10.2 experimental group 10 female 44 pathological type I 19.9 13.2 11.9 experimental group
Enter 2:
Library (tableone) dput (names (dt)) # variable name for viewing data
Output 2:
C ("gender", "age", "drinking or not", "pathological type", "degree of differentiation", "ALT", "AST", "test", "Group")
Enter 3:
# step1 create object tab1