Why my frequency table is showing wrong format? Frequency table is shown in picture.
My code is -
library(psych)
#> Warning: package 'psych' was built under R version 4.0.2
library(vcd)
#> Warning: package 'vcd' was built under R version 4.0.2
#> Loading required package: grid
library(DescTools)
#> Warning: package 'DescTools' was built under R version 4.0.2
#>
#> Attaching package: 'DescTools'
#> The following objects are masked from 'package:psych':
#>
#> AUC, ICC, SD
library(rcompanion)
#> Warning: package 'rcompanion' was built under R version 4.0.2
#>
#> Attaching package: 'rcompanion'
#> The following object is masked from 'package:psych':
#>
#> phi
df <- read.csv("F:/jar_test.csv", stringsAsFactors = F)
colnames(df)[1] = "sample_name"
colnames(df)[2] = "weak"
colnames(df)[3] = "JAR"
colnames(df)[4] = "strong"
ftable(df)
#> strong 40 41 42
#> sample_name weak JAR
#> 170 22 32 0 0 0
#> 37 0 0 0
#> 40 0 0 0
#> 24 32 0 0 0
#> 37 0 1 0
#> 40 0 0 0
#> 28 32 0 0 0
#> 37 0 0 0
#> 40 0 0 0
#> 896 22 32 0 0 0
#> 37 0 0 0
#> 40 1 0 0
#> 24 32 0 0 0
#> 37 0 0 0
#> 40 0 0 0
#> 28 32 0 0 0
#> 37 0 0 0
#> 40 0 0 0
#> 914 22 32 0 0 0
#> 37 0 0 0
#> 40 0 0 0
#> 24 32 0 0 0
#> 37 0 0 0
#> 40 0 0 0
#> 28 32 0 0 1
#> 37 0 0 0
#> 40 0 0 0
Created on 2020-08-04 by the reprex package (v0.3.0)