I have a dataframe which contains value of log2fold change but it contains inf and NA values i searched all over stack-exchange tried their solution but most of them seems not working few of them works but its not giving me the desired output  ,need help it should't be that difficult i suppose .

my data frame 

    GENE_NAME `HSC_VS_CMP` `HSC_VS_GMP``HSC_VS_Monocytes`
      
      ACTL6A  -0.20084399  0.297430 -0.350876000
      ACTR8    -0.2925280   -0.158551  1.10747
      AICDA      inf         NA           inf
       ANP32B  -0.6549    -0.615725    -0.35858


I get error like this "  default method not implemented for type 'list'
"

So please suggest me how to remove all the inf and NA from the data frame
Alternative (borrowed from [this SO answer][1]):

    # test data
    d <- mtcars
    
    # add NAs and Inf.
    d[1,1] <- NA
    d[2,2] <- NA
    d[2,1] <- Inf
    d[1,2] <- Inf

    head(d)
                       mpg cyl disp  hp drat    wt  qsec vs am gear carb
    Mazda RX4           NA Inf  160 110 3.90 2.620 16.46  0  1    4    4
    Mazda RX4 Wag      Inf  NA  160 110 3.90 2.875 17.02  0  1    4    4
    Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
    Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
    Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
    Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1
    
    # the magic:
    d <- do.call(data.frame, lapply(d, function(x) {
      replace(x, is.infinite(x) | is.na(x), 0)
      })
    )

    # note that you lose the row names.
    head(d)
       mpg cyl disp  hp drat    wt  qsec vs am gear carb
    1  0.0   0  160 110 3.90 2.620 16.46  0  1    4    4
    2  0.0   0  160 110 3.90 2.875 17.02  0  1    4    4
    3 22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
    4 21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
    5 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
    6 18.1   6  225 105 2.76 3.460 20.22  1  0    3    1

  [1]: http://stackoverflow.com/a/12188551/3742244