How To Check Array Count Function In R