data=
data.frame
(column1 =
c
(
Inf
, 2, 3, 4, 5),
column2=
c
(1,
Inf
, 1,
Inf
, 1),
column3=
c
(1,2,3,
Inf
,
Inf
),
column4=
c
(
Inf
,
Inf
,
Inf
,3,4),
column5=
c
(1,2,3,4,
Inf
))
print
(data)
final=
do.call
(data.frame,lapply
(data,
function
(value) replace
(value,
is.infinite
(value),
NA
)))
print
(final)