create a table that counts the number of times each integer from 1 to 100 appears in an array in r

# Creating a sample array
array_data <- sample(1:100, 1000, replace = TRUE)

# Counting the number of times each integer from 1 to 100 appears in the array
count_table <- as.data.frame(table(array_data))
names(count_table) <- c("Integer", "Frequency")

# Displaying the table
count_table
288 chars
10 lines

related categories

gistlibby LogSnag