0

I have to do an analysis of this dataset and I am already struggling with some coding! I have imported a column with the numbers from a given dataset created on a notepad, sample:

Numbers
1930.38
5550.84
2704.311**
2488.83
2965.48
4496.39
14641.7**
4963**
539.301**

I imported the long set through the R environment with the lines:

'df <- read_delim("C:/Users?/Final/cleaned_sales_2015.txt", 
                                 delim = "\t", escape_double = FALSE, 
                                 col_names = FALSE, col_types = cols(X2 = col_skip()), 
                                 locale = locale(), trim_ws = TRUE)'

I am having difficulties adapting the value on the column, due to the grouping and decimal mark. As you can see above there are numbers with no, one, two or three decimals.

When I redefine the decimal symbol to ",", R understands it as if it was the grouping mark and not the decimal! Is there anything I can do to clean it?

Here you can see the R environment> Import Text Data(readr) and the note file version of the dataset

  • 1
    We cannot read data into R from images. Please [make this question reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by including a small representative sample of the text file in a plain text format. It's not clear what the issue is: are there any warnings after import? – neilfws Jan 21 '22 at 00:05
  • Hey, I rewrote the question. Hope it helps =) – lkasquilici Jan 23 '22 at 14:57
  • I still don't understand the problem. Why would you redefine the decimal mark to a comma? It is not a comma in your example data. What do you mean by "difficulties adapting the value on the column" ? From the image in your question, it is not clear that anything is wrong with the imported data. – neilfws Jan 23 '22 at 21:54
  • Hi @neilfws, I am not sure anymore actually. I never worked with such a long dataset and it annoyed me the way the numbers were written. In Austria numbers are normally grouped by . and the decimals are by , so I was aiming that, but your right that it worked normally. – lkasquilici Jan 23 '22 at 22:03

0 Answers0