I am trying to read file with some empty cells and getting for empty cells an expected NA
.
I have some special columns which can only have the values ''
or '+'
. So I would like to set these columns to a factor class by using
read_tsv('file.txt',
col_types=list(
column_with_empty_cells=col_factor(c('','+'))))
But the column still has NAs
in these columns. I could change the global behaviour of the readr_tsv
function by changing the na
parameter, but this is not what I want. I want to change this only in specific columns.
Is there a way to convert these NAs
directly to ''
? I could do this afterwards for sure, but I am wondering if I am using the thing in the wrong way.
EDIT Here is a test file
How do I actually upload a file? I could only attach images...