This is quite easily done with lapply
:
# Generate sample data (10 columns x 100 rows) normally distributed around 0
my.df <- as.data.frame(matrix(rnorm(n=1000), ncol=10))
# Get the line numbers, for each column in the df
lapply(my.df, function(x) which(abs(x) > 2.5))
# $V1
# integer(0)
#
# $V2
# [1] 29 69
#
# $V3
# [1] 85
#
# $V4
# [1] 100
#
# $V5
# [1] 11 40
#
# $V6
# [1] 89
#
# $V7
# [1] 67
#
# $V8
# [1] 49 68
#
# $V9
# integer(0)
#
# $V10
# [1] 7 27
To get a formatting close to what you have given in your question, ExperimenteR kindly suggested this:
library(data.table)
setDT(my.df)[, list(lapply(.SD, function(x) which(abs(x) > 2.5))), ]
# V1
# 1:
# 2: 29,69
# 3: 85
# 4: 100
# 5: 11,40
# 6: 89
# 7: 67
# 8: 49,68
# 9:
# 10: 7,27
To rather get the total number, for each column in the df, use
lapply(my.df, function(x) sum(abs(x) > 2.5))
# $V1
# [1] 0
#
# $V2
# [1] 2
#
# $V3
# [1] 1
#
# $V4
# [1] 1
#
# $V5
# [1] 2
#
# $V6
# [1] 1
#
# $V7
# [1] 1
#
# $V8
# [1] 2
#
# $V9
# [1] 0
#
# $V10
# [1] 2