R seems to multiply my data by -1

后端 未结 1 1480
予麋鹿
予麋鹿 2021-01-23 16:50

Every time I try to upload a database into R (the file is in .xls, .csv or .txt) it transforms it and put a negative sign in front of every entry of my file. I do not really und

相关标签:
1条回答
  • 2021-01-23 17:50

    When you write

    > data<-- read.table("C:\\Users\\....)
    

    you are really writing

    > data <- - read.table("C:\\Users\\....)
    

    or equivalently

    > data <- (-1) * read.table("C:\\Users\\....)
    

    Just remove the second dash, and your data will not be multiplied by -1. R simply did what you told it to.

    0 讨论(0)
提交回复
热议问题