I have this code to read from a database table. I have almost all countries there including Namibia with code NA.
The area code NA is considered as a non available value in R. Is there a way in this code to tell the program that he should consider this dimension REF_AREA and COUNTERPART_AREA as character directly there.
I put a patch of course later on the change the na to an invented code and I have to reverse it when creating the csv file for laoding afterwards.
getITS_R = function(prod_stage = "R"){
ch <- odbcConnect("FIGARO", uid="figaro", pwd="figaro88", believeNRows=FALSE)
query <- paste0("select * from ITS6_INPUT where PROD_STAGE = '", prod_stage,"' and UNIT_MEASURE = 'EUR' ;")
its6_input = data.table(sqlQuery(ch, query, as.is = TRUE))
return(its6_input)
close(ch)
}
Thanks.