keeping a needed NA value but also replacing the NA by empty fields

I ve a dataset which contans a field out off the database with NA as result, which I must keep. The output I created with

write.table(dataset,row.names=FALSE,sep=";",na=""

,file="C:\Users\mwijn\OneDrive\Documenten\Engie\Output\Delete_File.csv")

because I use na="" all fields are blank, but the field SS Reason should contain na if empty. could use a IF then statement I think but due to I ve less experience in R, found no correct way to solve this.

Hope someone can help in this.

File SSV Action Wall Mount SS Reason Number Floors Height Cable
EXPORT N IRREG 2
EXPORT N IRREG 3
EXPORT N IRREG 2
EXPORT Y 2 5
EXPORT N IRREG 2
EXPORT Y 2 5
EXPORT Y 2 5
EXPORT N IRREG 2
EXPORT Y 2 5
EXPORT N IRREG 2
EXPORT N IRREG 2
EXPORT N IRREG 2
EXPORT N IRREG 2
EXPORT N IRREG 2
EXPORT N IRREG 2

This looks like a problem to be solved long before a *write.table command.

We need to see some sample raw data and the output data. Some code would also be useful.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.