Forum Discussion

quantfinRguy's avatar
quantfinRguy
Frequent Visitor
9 years ago

R error - "We cannot convert the input due to duplicate column names:"

I am trying to imput several data.tables through R but I keep running into this error.

 

I have no idea what is causing it, since none of my data imported into the R script has a "Total" column, nor do any of the outputs. I removed them all, but the issue still persists. 

 

Anyone have a solution?

5 Replies

  • Could you attach a screenshot? It might provide a little more context as to what's causing the problem.

     

    Cheers,

     

    George.

    • quantfinRguy's avatar
      quantfinRguy
      Frequent Visitor

      The Error message

      Output

      There are 4 output tables. I could easily combine them with a 5th column with an identifier value. The error occurs before the script executes. 

       

      90% of the input data are used in other scripts that import on other scripts without error, so I know it isn't those. 

       

      The only other table does not have a "Total" column. 

       

      The script executes perfectly fine when sourced in in RStudio.

  • v-sihou-msft's avatar
    v-sihou-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    quantfinRguy

     

    As you said, you imported "several" data.tables, it's only supported to get one dataset each time from any query or script when retrieving data. So make sure your R script return only one result set. 

     

    Regards,

    • quantfinRguy's avatar
      quantfinRguy
      Frequent Visitor

      v-sihou-msft

       

      I was able to import all 4 data tables in one data pull. 

       

      The script worked fine when copy and pasted into the pop-up window rather than running "source(...)"

       

      This seems to be a bug.

      • hectoragre's avatar
        hectoragre
        Regular Visitor

        Hi quantfinRguy

         

        I am in the same situation ... Could you tell me what do you reffer with "  worked fine into the pop-up window rather than running "source(...)""?

         

        Normally to load data I used Get data > Other > R script 

         

        Thanks in advance!