Data import error in R

Asked

Viewed 42 times

1

Hello! I imported a base I requested via LAI for R. They sent me in excel, but I converted it into csv by working facilities. I know that when transforming all data from "character" columns to "Numeric", one of them gets the values multiplied by 1000. If I turn to "integer", this problem does not happen and I’m thinking of working with the base like this. This does not occur when importing the same data in excel, all columns remain with the same values as they were when in character... What can it be?

  • 1

    Can you please, edit the question with 1) the instructions you used to import the CSV file. 2) the output of dput(dados) or, if the base is too large, dput(head(dados 20))?

  • This happens because csv is probably separating decimals by "," and not by "." as expected by R. You can try using the function read.csv2 and see if it corrects the problem.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.