Convert R NA types to .NET types.

Hi please let me know if this is not appropriate and I can take this down. I'm trying to figure out how to handle the interaction with a Web API in .NET with R.

In R, we have bool type with a value of NA. When we convert to JSON, this becomes a string "NA". To go from JSON to C#, this becomes an issue because NA is not a valid bool value in C#?

I'm just wondering if anyone else in this community has overcome these different NA cases and what the appropriate approach would be? We do want to persist the NA value and not have it convert to null.

Thanks for any suggestions!

seems like a pure C# issue, so I would go to C# experts.
Presumably you would need a datatype that represents logicals (TRUE , FALSE with some non TRUE / FALSE state, like null or Na or whategver), so either other C# users had that need and there are packages you can use and follow, or you are the first and will need to make your own class to represent the datatype.
good luck :slight_smile:

This topic was automatically closed 7 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.