1 year ago

#77211

test-img

lkasquilici

Importing dataset: decimals and grouping problem

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

r

import

data-cleaning

readr

0 Answers

Your Answer

Accepted video resources