NA values appear as simply NA, not as #N/A. What you have are probably character values of #N/A. That will force the entire column to be characters. Running the summary() function on the data frame will confirm this. You probably want to convert the #N/A to NA and then convert the columns to be numbers with as.numeric().