DomoR Datatype Conversions

I'm using DomoR to fetch a dataset and a column that should be text is being read in as col_double(). Many values are only digits, but other values contain characters so must be read as a text field. Is there a way I can control for the incoming datatype so I don't lose those character fields? An example of the error message is below.

 

I'm thinking of ordering the incoming Domo dataset to put character values first...but wanted to ask this question while I work on that.

 

Thanks!

 

Warning: 25704 parsing failures.
row   col    expected  actual   file
3316 DonorID a double DNM002141 <raw vector>
10350 DonorID a double DNM026515 <raw vector>
13129 DonorID a double DNM004163 <raw vector>
13130 DonorID a double DNM004162 <raw vector>
19087 DonorID no trailing characters AB5KLCAA3 <raw vector>

Best Answer

  • kelly_tagtow
    kelly_tagtow ⚪️
    Accepted Answer

    Thank you @jaeW_at_Onyx . That is what I did to solve this situation yesterday:

    1. Create a new column of a simple text field prefix (TF-)
    2. Concatenated to the column(s) I needed to force as text fields, dropping the prefix and old column along the way
    3. And then when the new field was passed to R - as a text datatype - used a gsub to replace TF- with and empty string...leaving me with the original ID field.

    I've seen other R packages allow for the datatype control on input, so didn't know if that was an option available, or perhaps in the works.

     

    Again, thanks for your input. It confirmed my direction and solution.

     


    @jaeW_at_Onyx wrote:

    @kelly_tagtow  if it were me, I would add a text character in front of the Donor ID upon initial ingestion into Domo.  

     

    That way you're confident that at ANY PART of the pipeline in Domo (whether Magic, R, or Analyzer), the data gets treated appropriately and no truncation happens.

     

    If you're worried about mangling the data, you could have two columns, Donor_ID, Donor_ID_text.

     

    I know it's not the answer to your question, but it is what I would recommend to my clients.


     

Answers

  • GrantSmith
    GrantSmith Indiana 🔴

    What data type is the column stored as on the dataset within Domo?

  • @GrantSmith It is a Text field in Domo

  • jaeW_at_Onyx
    jaeW_at_Onyx Budapest / Portland, OR 🟤

    @kelly_tagtow  if it were me, I would add a text character in front of the Donor ID upon initial ingestion into Domo.  

     

    That way you're confident that at ANY PART of the pipeline in Domo (whether Magic, R, or Analyzer), the data gets treated appropriately and no truncation happens.

     

    If you're worried about mangling the data, you could have two columns, Donor_ID, Donor_ID_text.

     

    I know it's not the answer to your question, but it is what I would recommend to my clients.